Package org.apache.sling.distribution.journal.impl.publisher

# Class PublishMetrics

java.lang.Object
org.apache.sling.distribution.journal.impl.publisher.PublishMetrics

public class PublishMetrics extends Object

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`PUB_COMPONENT`

## Constructor Summary

Constructors
Constructor
Description
`PublishMetrics(org.apache.sling.commons.metrics.MetricsService metricsService, String pubAgentName)`

## Method Summary

Modifier and Type
Method
Description
`org.apache.sling.commons.metrics.Meter`
`getAcceptedRequests()`
Meter of requests returning an `DistributionRequestState.ACCEPTED` state.
`org.apache.sling.commons.metrics.Timer`
`getBuildPackageDuration()`
Timer capturing the duration in ms of building a content package
`org.apache.sling.commons.metrics.Meter`
`getDroppedRequests()`
Meter of requests returning an `DistributionRequestState.DROPPED` state.
`org.apache.sling.commons.metrics.Timer`
`getEnqueuePackageDuration()`
Timer capturing the duration in ms of adding a package to the queue
`org.apache.sling.commons.metrics.Histogram`
`getExportedPackageSize()`
Histogram of the exported content package size in Bytes.
`org.apache.sling.commons.metrics.Counter`
`getQueueAccessErrorCount()`
Counter of queue access errors.
`org.apache.sling.commons.metrics.Counter`
`getQueueCacheFetchCount()`
Counter of fetch operations to feed the queue cache.
`void`
`queueSize(Supplier<Integer> queueSizeCallback)`
`void`
`subscriberCount(Supplier<Integer> subscriberCountCallback)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### PUB_COMPONENT

public static final String PUB_COMPONENT

See Also:
  - Constant Field Values

## Constructor Details

### PublishMetrics

public PublishMetrics(org.apache.sling.commons.metrics.MetricsService metricsService, String pubAgentName)

## Method Details

### 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

### 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

### subscriberCount

public void subscriberCount(Supplier<Integer> subscriberCountCallback)

### queueSize

public void queueSize(Supplier<Integer> queueSizeCallback)