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.-
Field Summary
Fields inherited from interface org.opencastproject.statistics.api.StatisticsService
JOB_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(org.osgi.service.component.ComponentContext cc) voidaddProvider(StatisticsProvider provider) Add the given provider to the list of active providers.voidaddWriter(StatisticsWriter writer) Add a new writer instancevoiddeactivate(org.osgi.service.component.ComponentContext cc) getProvider(String providerId) getProviders(ResourceType resourceType) getTimeSeriesData(StatisticsProvider provider, String resourceId, Instant from, Instant to, DataResolution resolution, ZoneId zoneId) Get time series statistics data from the given Provider.voidremoveProvider(StatisticsProvider provider) Remove the given provider from the list of active providers.voidremoveWriter(String id) Remove a writervoidwriteDuration(String organizationId, String measurementName, String retentionPolicy, String organizationIdResourceName, String fieldName, TimeUnit temporalResolution, Duration duration) Write a duration to a statistics data base
-
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
- Specified by:
getProvidersin interfaceStatisticsService- Returns:
- All active providers.
-
getProviders
- Specified by:
getProvidersin interfaceStatisticsService- Parameters:
resourceType- The resource type.- Returns:
- All active providers for the given resource type.
-
getProvider
- Specified by:
getProviderin interfaceStatisticsService- 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:StatisticsServiceGet time series statistics data from the given Provider.- Specified by:
getTimeSeriesDatain interfaceStatisticsService- 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
Description copied from interface:StatisticsCoordinatorAdd a new writer instance- Specified by:
addWriterin interfaceStatisticsCoordinator- Parameters:
writer- the writer instance
-
removeWriter
Description copied from interface:StatisticsCoordinatorRemove a writer- Specified by:
removeWriterin interfaceStatisticsCoordinator- 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:StatisticsServiceWrite a duration to a statistics data base- Specified by:
writeDurationin interfaceStatisticsService- Parameters:
organizationId- Organization ID of the data pointmeasurementName- Measurement name of the data pointretentionPolicy- Retention policy of the data pointorganizationIdResourceName- Resource name for the organizationfieldName- Field name to writetemporalResolution- The temporal resolution to store it induration- The actual duration to write
-
addProvider
Description copied from interface:StatisticsCoordinatorAdd the given provider to the list of active providers.- Specified by:
addProviderin interfaceStatisticsCoordinator- Parameters:
provider- The provider to add.
-
removeProvider
Description copied from interface:StatisticsCoordinatorRemove the given provider from the list of active providers.- Specified by:
removeProviderin interfaceStatisticsCoordinator- Parameters:
provider- The provider to remove.
-