Class DistributionMetricsService

java.lang.Object
org.apache.sling.distribution.journal.shared.DistributionMetricsService

public class DistributionMetricsService
extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • activate

      public void activate​(org.osgi.framework.BundleContext context)
    • timed

      public static void timed​(org.apache.sling.commons.metrics.Timer metric, Runnable code) throws Exception
      Runs provided code updating provided metric with its execution time. The method guarantees that the metric is updated even if the code throws an exception
      Parameters:
      metric - metric to update
      code - code to clock
      Throws:
      Exception - actually it doesn't
    • timed

      public static <T> T timed​(org.apache.sling.commons.metrics.Timer metric, Callable<T> code) throws Exception
      Runs provided code updating provided metric with its execution time. The method guarantees that the metric is updated even if the code throws an exception
      Parameters:
      metric - metric to update
      code - code to clock
      Returns:
      a value returned but code.call() invocation
      Throws:
      Exception - if underlying code throws
    • getCleanupPackageRemovedCount

      public org.apache.sling.commons.metrics.Counter getCleanupPackageRemovedCount()
      Counter of package removed during the Package Cleanup Task. The count is the sum of all packages removed since the service started.
      Returns:
      a Sling Metrics timer
    • getCleanupPackageDuration

      public org.apache.sling.commons.metrics.Timer getCleanupPackageDuration()
      Timer of the Package Cleanup Task execution duration.
      Returns:
      a Sling Metrics timer
    • getImportedPackageSize

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

      public org.apache.sling.commons.metrics.Histogram getExportedPackageSize()
      Histogram of the exported content package size in Bytes.
      Returns:
      a Sling Metrics histogram
    • getAcceptedRequests

      public org.apache.sling.commons.metrics.Meter getAcceptedRequests()
      Meter of requests returning an DistributionRequestState.ACCEPTED state.
      Returns:
      a Sling Metrics meter
    • getDroppedRequests

      public org.apache.sling.commons.metrics.Meter getDroppedRequests()
      Meter of requests returning an DistributionRequestState.DROPPED state.
      Returns:
      a Sling Metrics meter
    • 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
    • getBuildPackageDuration

      public org.apache.sling.commons.metrics.Timer getBuildPackageDuration()
      Timer capturing the duration in ms of building a content package
      Returns:
      a Sling Metric timer
    • getEnqueuePackageDuration

      public org.apache.sling.commons.metrics.Timer getEnqueuePackageDuration()
      Timer capturing the duration in ms of adding a package to the queue
      Returns:
      a Sling Metric timer
    • getQueueCacheFetchCount

      public org.apache.sling.commons.metrics.Counter getQueueCacheFetchCount()
      Counter of fetch operations to feed the queue cache.
      Returns:
      a Sling Metric counter
    • getQueueAccessErrorCount

      public org.apache.sling.commons.metrics.Counter getQueueAccessErrorCount()
      Counter of queue access errors.
      Returns:
      a Sling Metric counter
    • getJournalErrorCodeCount

      public org.apache.sling.commons.metrics.Counter getJournalErrorCodeCount​(String errorCode)
      Counter of journal error codes.
      Returns:
      a Sling Metric counter
    • createGauge

      public <T> DistributionMetricsService.GaugeService<T> createGauge​(String name, String description, Supplier<T> supplier)
    • 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()