Class DistributionMetricsService
- java.lang.Object
-
- org.apache.sling.distribution.journal.shared.DistributionMetricsService
-
public class DistributionMetricsService extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classDistributionMetricsService.GaugeService<T>
-
Field Summary
Fields Modifier and Type Field Description static StringBASE_COMPONENTstatic StringPUB_COMPONENTstatic StringSUB_COMPONENT
-
Constructor Summary
Constructors Constructor Description DistributionMetricsService()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate(org.osgi.framework.BundleContext context)<T> DistributionMetricsService.GaugeService<T>createGauge(String name, String description, Supplier<T> supplier)org.apache.sling.commons.metrics.MetergetAcceptedRequests()Meter of requests returning anDistributionRequestState.ACCEPTEDstate.org.apache.sling.commons.metrics.TimergetBuildPackageDuration()Timer capturing the duration in ms of building a content packageorg.apache.sling.commons.metrics.TimergetCleanupPackageDuration()Timer of the Package Cleanup Task execution duration.org.apache.sling.commons.metrics.CountergetCleanupPackageRemovedCount()Counter of package removed during the Package Cleanup Task.org.apache.sling.commons.metrics.MetergetDroppedRequests()Meter of requests returning anDistributionRequestState.DROPPEDstate.org.apache.sling.commons.metrics.TimergetEnqueuePackageDuration()Timer capturing the duration in ms of adding a package to the queueorg.apache.sling.commons.metrics.HistogramgetExportedPackageSize()Histogram of the exported content package size in Bytes.org.apache.sling.commons.metrics.MetergetFailedPackageImports()Meter of failures to import packages.org.apache.sling.commons.metrics.TimergetImportedPackageDuration()Timer capturing the duration in ms of successful packages import operations.org.apache.sling.commons.metrics.HistogramgetImportedPackageSize()Histogram of the imported content package size in Byte.org.apache.sling.commons.metrics.TimergetImportPostProcessDuration()org.apache.sling.commons.metrics.CountergetImportPostProcessRequest()org.apache.sling.commons.metrics.CountergetImportPostProcessSuccess()org.apache.sling.commons.metrics.TimergetInvalidationProcessDuration()org.apache.sling.commons.metrics.CountergetInvalidationProcessRequest()org.apache.sling.commons.metrics.CountergetInvalidationProcessSuccess()org.apache.sling.commons.metrics.CountergetItemsBufferSize()Counter of the package buffer size on the subscriber.org.apache.sling.commons.metrics.CountergetJournalErrorCodeCount(String errorCode)Counter of journal error codes.org.apache.sling.commons.metrics.TimergetPackageDistributedDuration()Timer capturing the duration in ms of distributing a distribution package.org.apache.sling.commons.metrics.CountergetPackageStatusCounter(String status)Counter for all the different package status.org.apache.sling.commons.metrics.CountergetPermanentImportErrors()org.apache.sling.commons.metrics.TimergetProcessQueueItemDuration()Timer capturing the duration in ms of processing a queue item.org.apache.sling.commons.metrics.CountergetQueueAccessErrorCount()Counter of queue access errors.org.apache.sling.commons.metrics.CountergetQueueCacheFetchCount()Counter of fetch operations to feed the queue cache.org.apache.sling.commons.metrics.TimergetRemovedFailedPackageDuration()Timer capturing the duration in ms of packages successfully removed automatically from a subscriber supporting error queue.org.apache.sling.commons.metrics.TimergetRemovedPackageDuration()Timer capturing the duration in ms of packages successfully removed from an editable subscriber.org.apache.sling.commons.metrics.TimergetSendStoredStatusDuration()Timer capturing the duration in ms of sending a stored package status.org.apache.sling.commons.metrics.CountergetTransientImportErrors()static voidtimed(org.apache.sling.commons.metrics.Timer metric, Runnable code)Runs provided code updating provided metric with its execution time.static <T> Ttimed(org.apache.sling.commons.metrics.Timer metric, Callable<T> code)Runs provided code updating provided metric with its execution time.
-
-
-
Field Detail
-
BASE_COMPONENT
public static final String BASE_COMPONENT
- See Also:
- Constant Field Values
-
PUB_COMPONENT
public static final String PUB_COMPONENT
- See Also:
- Constant Field Values
-
SUB_COMPONENT
public static final String SUB_COMPONENT
- See Also:
- Constant Field Values
-
-
Method Detail
-
activate
public void activate(org.osgi.framework.BundleContext context)
-
timed
public static void timed(org.apache.sling.commons.metrics.Timer metric, Runnable code) throws ExceptionRuns 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 updatecode- 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 ExceptionRuns 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 updatecode- 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 anDistributionRequestState.ACCEPTEDstate.- Returns:
- a Sling Metrics meter
-
getDroppedRequests
public org.apache.sling.commons.metrics.Meter getDroppedRequests()
Meter of requests returning anDistributionRequestState.DROPPEDstate.- 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
-
getPackageStatusCounter
public org.apache.sling.commons.metrics.Counter getPackageStatusCounter(String status)
Counter for all the different package status.- 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()
-
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()
-
-