Class SubscriberMetrics

java.lang.Object
org.apache.sling.distribution.journal.bookkeeper.SubscriberMetrics

public class SubscriberMetrics extends Object
Metrics for DistributionSubscriber most metrics will have two parameters: TAG_SUB_NAME and TAG_EDITABLE
  • Field Details

  • Constructor Details

    • SubscriberMetrics

      public SubscriberMetrics(org.apache.sling.commons.metrics.MetricsService metricsService, String subAgentName, String pubAgentName, boolean editable)
  • Method Details

    • getImportedPackageSize

      public org.apache.sling.commons.metrics.Histogram getImportedPackageSize()
      Histogram of the imported content package size in Byte.
      Returns:
      a Sling Metrics histogram
    • getItemsBufferSize

      public org.apache.sling.commons.metrics.Counter getItemsBufferSize()
      Counter of the package buffer size on the subscriber.
      Returns:
      a Sling Metrics counter
    • getImportedPackageDuration

      public org.apache.sling.commons.metrics.Timer getImportedPackageDuration()
      Timer capturing the duration in ms of successful packages import operations.
      Returns:
      a Sling Metrics timer
    • getRemovedPackageDuration

      public org.apache.sling.commons.metrics.Timer getRemovedPackageDuration()
      Timer capturing the duration in ms of packages successfully removed from an editable subscriber.
      Returns:
      a Sling Metrics timer
    • getRemovedFailedPackageDuration

      public org.apache.sling.commons.metrics.Timer getRemovedFailedPackageDuration()
      Timer capturing the duration in ms of packages successfully removed automatically from a subscriber supporting error queue.
      Returns:
      a Sling Metrics timer
    • getFailedPackageImports

      public org.apache.sling.commons.metrics.Meter getFailedPackageImports()
      Meter of failures to import packages.
      Returns:
      a Sling Metrics meter
    • getSendStoredStatusDuration

      public org.apache.sling.commons.metrics.Timer getSendStoredStatusDuration()
      Timer capturing the duration in ms of sending a stored package status.
      Returns:
      a Sling Metric timer
    • getProcessQueueItemDuration

      public org.apache.sling.commons.metrics.Timer getProcessQueueItemDuration()
      Timer capturing the duration in ms of processing a queue item.
      Returns:
      a Sling Metric timer
    • getPackageDistributedDuration

      public org.apache.sling.commons.metrics.Timer getPackageDistributedDuration()
      Timer capturing the duration in ms of distributing a distribution package. The timer starts when the package is enqueued and stops when the package is successfully imported.
      Returns:
      a Sling Metric timer
    • getPackageJournalDistributionDuration

      public org.apache.sling.commons.metrics.Timer getPackageJournalDistributionDuration()
      Timer capturing the duration in ms that a package spent in the distribution journal. The timer starts when the package is enqueued and stops when the package is consumed.
      Returns:
      a Sling Metrics timer
    • getPackageStatusCounter

      public org.apache.sling.commons.metrics.Counter getPackageStatusCounter(String pubAgentName, org.apache.sling.distribution.journal.messages.PackageStatusMessage.Status status)
      Counter for all the different package status.
      Parameters:
      pubAgentName - name of publish agent
      status - after package import
      Returns:
      a Sling Metric counter
    • getImportPreProcessDuration

      public org.apache.sling.commons.metrics.Timer getImportPreProcessDuration()
    • getImportPreProcessSuccess

      public org.apache.sling.commons.metrics.Counter getImportPreProcessSuccess()
    • getImportPreProcessRequest

      public org.apache.sling.commons.metrics.Counter getImportPreProcessRequest()
    • getImportPostProcessDuration

      public org.apache.sling.commons.metrics.Timer getImportPostProcessDuration()
    • getImportPostProcessSuccess

      public org.apache.sling.commons.metrics.Counter getImportPostProcessSuccess()
    • getImportPostProcessRequest

      public org.apache.sling.commons.metrics.Counter getImportPostProcessRequest()
    • getInvalidationProcessDuration

      public org.apache.sling.commons.metrics.Timer getInvalidationProcessDuration()
    • getInvalidationProcessSuccess

      public org.apache.sling.commons.metrics.Counter getInvalidationProcessSuccess()
    • getInvalidationProcessRequest

      public org.apache.sling.commons.metrics.Counter getInvalidationProcessRequest()
    • getTransientImportErrors

      public org.apache.sling.commons.metrics.Counter getTransientImportErrors()
    • getPermanentImportErrors

      public org.apache.sling.commons.metrics.Counter getPermanentImportErrors()
    • getBlockingImportErrors

      public org.apache.sling.commons.metrics.Counter getBlockingImportErrors()
    • currentRetries

      public void currentRetries(Supplier<Integer> retriesCallback)
    • currentImportDuration

      public void currentImportDuration(Supplier<Long> importDurationCallback)
    • getCurrentImportDurationCallback

      public Supplier<Long> getCurrentImportDurationCallback()
      For testing
      Returns:
      callback