Interface StatisticsService
- All Known Implementing Classes:
StatisticsServiceImpl,StatisticsServiceRemoteImpl
public interface StatisticsService
Statistics service API.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiongetProvider(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.voidwriteDuration(String organizationId, String measurementName, String retentionPolicy, String organizationIdResourceName, String fieldName, TimeUnit temporalResolution, Duration duration) Write a duration to a statistics data base
-
Field Details
-
JOB_TYPE
Identifier for service registration and location- See Also:
-
-
Method Details
-
getProviders
Set<StatisticsProvider> getProviders()- Returns:
- All active providers.
-
getProviders
- Parameters:
resourceType- The resource type.- Returns:
- All active providers for the given resource type.
-
getProvider
- Parameters:
providerId- The provider id.- Returns:
- Optionally return the provider with the given id (if any).
-
getTimeSeriesData
TimeSeries getTimeSeriesData(StatisticsProvider provider, String resourceId, Instant from, Instant to, DataResolution resolution, ZoneId zoneId) Get time series statistics data from the given Provider.- 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.
-
writeDuration
void writeDuration(String organizationId, String measurementName, String retentionPolicy, String organizationIdResourceName, String fieldName, TimeUnit temporalResolution, Duration duration) Write a duration to a statistics data base- 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
-