Interface StatisticsService


public interface StatisticsService
Statistics service API.
  • Field Details

  • Method Details

    • getProviders

      Set<StatisticsProvider> getProviders()
      Returns:
      All active providers.
    • getProviders

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

      Optional<StatisticsProvider> getProvider(String providerId)
      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 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