Class StatisticsServiceImpl

java.lang.Object
org.opencastproject.statistics.impl.StatisticsServiceImpl
All Implemented Interfaces:
StatisticsCoordinator, StatisticsService

public class StatisticsServiceImpl extends Object implements StatisticsService, StatisticsCoordinator
Implements StatisticsService. Uses influxdb for permanent storage.
  • Constructor Details

    • StatisticsServiceImpl

      public StatisticsServiceImpl()
  • Method Details

    • activate

      public void activate(org.osgi.service.component.ComponentContext cc)
    • deactivate

      public void deactivate(org.osgi.service.component.ComponentContext cc)
    • getProviders

      public Set<StatisticsProvider> getProviders()
      Specified by:
      getProviders in interface StatisticsService
      Returns:
      All active providers.
    • getProviders

      public Set<StatisticsProvider> getProviders(ResourceType resourceType)
      Specified by:
      getProviders in interface StatisticsService
      Parameters:
      resourceType - The resource type.
      Returns:
      All active providers for the given resource type.
    • getProvider

      public Optional<StatisticsProvider> getProvider(String providerId)
      Specified by:
      getProvider in interface StatisticsService
      Parameters:
      providerId - The provider id.
      Returns:
      Optionally return the provider with the given id (if any).
    • getTimeSeriesData

      public TimeSeries getTimeSeriesData(StatisticsProvider provider, String resourceId, Instant from, Instant to, DataResolution resolution, ZoneId zoneId)
      Description copied from interface: StatisticsService
      Get time series statistics data from the given Provider.
      Specified by:
      getTimeSeriesData in interface StatisticsService
      Parameters:
      provider - The provider to retrieve statistics from.
      resourceId - The id to access the resource to get statistics for (e.g. episode Id, organization Id or series Id).
      from - The start date to calculate the statistics for.
      to - The end date to calculate the statistics for.
      resolution - The resolution to get the statistics with.
      zoneId - The timezone to use for date calculations.
      Returns:
      The time series data.
    • addWriter

      public void addWriter(StatisticsWriter writer)
      Description copied from interface: StatisticsCoordinator
      Add a new writer instance
      Specified by:
      addWriter in interface StatisticsCoordinator
      Parameters:
      writer - the writer instance
    • removeWriter

      public void removeWriter(String id)
      Description copied from interface: StatisticsCoordinator
      Remove a writer
      Specified by:
      removeWriter in interface StatisticsCoordinator
      Parameters:
      id - the writer's ID
    • writeDuration

      public void writeDuration(String organizationId, String measurementName, String retentionPolicy, String organizationIdResourceName, String fieldName, TimeUnit temporalResolution, Duration duration)
      Description copied from interface: StatisticsService
      Write a duration to a statistics data base
      Specified by:
      writeDuration in interface StatisticsService
      Parameters:
      organizationId - Organization ID of the data point
      measurementName - Measurement name of the data point
      retentionPolicy - Retention policy of the data point
      organizationIdResourceName - Resource name for the organization
      fieldName - Field name to write
      temporalResolution - The temporal resolution to store it in
      duration - The actual duration to write
    • addProvider

      public void addProvider(StatisticsProvider provider)
      Description copied from interface: StatisticsCoordinator
      Add the given provider to the list of active providers.
      Specified by:
      addProvider in interface StatisticsCoordinator
      Parameters:
      provider - The provider to add.
    • removeProvider

      public void removeProvider(StatisticsProvider provider)
      Description copied from interface: StatisticsCoordinator
      Remove the given provider from the list of active providers.
      Specified by:
      removeProvider in interface StatisticsCoordinator
      Parameters:
      provider - The provider to remove.