Class MetricsCollector.Snapshot.Builder
java.lang.Object
com.soklet.MetricsCollector.Snapshot.Builder
- Enclosing class:
MetricsCollector.Snapshot
Builder used to construct instances of
MetricsCollector.Snapshot.
This class is intended for use by a single thread.
- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionactiveRequests(@NonNull Long activeRequests) Sets the active HTTP request count.activeSseConnections(@NonNull Long activeSseConnections) Sets the active server-sent event connection count.build()Builds aMetricsCollector.Snapshotinstance.httpConnectionsAccepted(@NonNull Long httpConnectionsAccepted) Sets the total number of accepted HTTP connections.httpConnectionsRejected(@NonNull Long httpConnectionsRejected) Sets the total number of rejected HTTP connections.httpHandlerDurations(@Nullable Map<@NonNull MetricsCollector.ServerRouteStatusKey, @NonNull MetricsCollector.HistogramSnapshot> httpHandlerDurations) Sets HTTP handler duration histograms keyed by server route and status class.httpRequestBodyBytes(@Nullable Map<@NonNull MetricsCollector.ServerRouteKey, @NonNull MetricsCollector.HistogramSnapshot> httpRequestBodyBytes) Sets HTTP request body size histograms keyed by server route.httpRequestDurations(@Nullable Map<@NonNull MetricsCollector.ServerRouteStatusKey, @NonNull MetricsCollector.HistogramSnapshot> httpRequestDurations) Sets HTTP request duration histograms keyed by server route and status class.httpRequestReadFailures(@Nullable Map<@NonNull MetricsCollector.RequestReadFailureKey, @NonNull Long> httpRequestReadFailures) Sets HTTP request read failure counters keyed by failure reason.httpRequestRejections(@Nullable Map<@NonNull MetricsCollector.RequestRejectionKey, @NonNull Long> httpRequestRejections) Sets HTTP request rejection counters keyed by rejection reason.httpResponseBodyBytes(@Nullable Map<@NonNull MetricsCollector.ServerRouteStatusKey, @NonNull MetricsCollector.HistogramSnapshot> httpResponseBodyBytes) Sets HTTP response body size histograms keyed by server route and status class.httpTimeToFirstByte(@Nullable Map<@NonNull MetricsCollector.ServerRouteStatusKey, @NonNull MetricsCollector.HistogramSnapshot> httpTimeToFirstByte) Sets HTTP time-to-first-byte histograms keyed by server route and status class.sseCommentDeliveryLag(@Nullable Map<@NonNull MetricsCollector.ServerSentEventCommentRouteKey, @NonNull MetricsCollector.HistogramSnapshot> sseCommentDeliveryLag) Sets SSE comment delivery lag histograms keyed by route and comment type.sseCommentDrops(@Nullable Map<@NonNull MetricsCollector.ServerSentEventCommentRouteDropKey, @NonNull Long> sseCommentDrops) Sets SSE comment drop counters keyed by route, comment type, and drop reason.sseCommentEnqueueOutcomes(@Nullable Map<@NonNull MetricsCollector.ServerSentEventCommentRouteEnqueueOutcomeKey, @NonNull Long> sseCommentEnqueueOutcomes) Sets SSE comment enqueue outcome counters keyed by route, comment type, and outcome.sseCommentQueueDepth(@Nullable Map<@NonNull MetricsCollector.ServerSentEventCommentRouteKey, @NonNull MetricsCollector.HistogramSnapshot> sseCommentQueueDepth) Sets SSE comment queue depth histograms keyed by route and comment type.sseCommentSizes(@Nullable Map<@NonNull MetricsCollector.ServerSentEventCommentRouteKey, @NonNull MetricsCollector.HistogramSnapshot> sseCommentSizes) Sets SSE comment size histograms keyed by route and comment type.sseConnectionDurations(@Nullable Map<@NonNull MetricsCollector.ServerSentEventRouteTerminationKey, @NonNull MetricsCollector.HistogramSnapshot> sseConnectionDurations) Sets SSE connection duration histograms keyed by route and termination reason.sseConnectionsAccepted(@NonNull Long sseConnectionsAccepted) Sets the total number of accepted SSE connections.sseConnectionsRejected(@NonNull Long sseConnectionsRejected) Sets the total number of rejected SSE connections.sseEventDeliveryLag(@Nullable Map<@NonNull MetricsCollector.ServerSentEventRouteKey, @NonNull MetricsCollector.HistogramSnapshot> sseEventDeliveryLag) Sets SSE event delivery lag histograms keyed by route.sseEventDrops(@Nullable Map<@NonNull MetricsCollector.ServerSentEventRouteDropKey, @NonNull Long> sseEventDrops) Sets SSE event drop counters keyed by route and drop reason.sseEventEnqueueOutcomes(@Nullable Map<@NonNull MetricsCollector.ServerSentEventRouteEnqueueOutcomeKey, @NonNull Long> sseEventEnqueueOutcomes) Sets SSE event enqueue outcome counters keyed by route and outcome.sseEventSizes(@Nullable Map<@NonNull MetricsCollector.ServerSentEventRouteKey, @NonNull MetricsCollector.HistogramSnapshot> sseEventSizes) Sets SSE event size histograms keyed by route.sseEventWriteDurations(@Nullable Map<@NonNull MetricsCollector.ServerSentEventRouteKey, @NonNull MetricsCollector.HistogramSnapshot> sseEventWriteDurations) Sets SSE event write duration histograms keyed by route.sseHandshakesAccepted(@Nullable Map<@NonNull MetricsCollector.ServerSentEventRouteKey, @NonNull Long> sseHandshakesAccepted) Sets SSE handshake acceptance counters keyed by route.sseHandshakesRejected(@Nullable Map<@NonNull MetricsCollector.ServerSentEventRouteHandshakeFailureKey, @NonNull Long> sseHandshakesRejected) Sets SSE handshake rejection counters keyed by route and failure reason.sseQueueDepth(@Nullable Map<@NonNull MetricsCollector.ServerSentEventRouteKey, @NonNull MetricsCollector.HistogramSnapshot> sseQueueDepth) Sets SSE queue depth histograms keyed by route.sseRequestReadFailures(@Nullable Map<@NonNull MetricsCollector.RequestReadFailureKey, @NonNull Long> sseRequestReadFailures) Sets SSE request read failure counters keyed by failure reason.sseRequestRejections(@Nullable Map<@NonNull MetricsCollector.RequestRejectionKey, @NonNull Long> sseRequestRejections) Sets SSE request rejection counters keyed by rejection reason.sseTimeToFirstEvent(@Nullable Map<@NonNull MetricsCollector.ServerSentEventRouteKey, @NonNull MetricsCollector.HistogramSnapshot> sseTimeToFirstEvent) Sets SSE time-to-first-event histograms keyed by route.
-
Method Details
-
activeRequests
Sets the active HTTP request count.- Parameters:
activeRequests- the active HTTP request count- Returns:
- this builder
-
activeSseConnections
public @NonNull MetricsCollector.Snapshot.Builder activeSseConnections(@NonNull Long activeSseConnections) Sets the active server-sent event connection count.- Parameters:
activeSseConnections- the active SSE connection count- Returns:
- this builder
-
httpConnectionsAccepted
public @NonNull MetricsCollector.Snapshot.Builder httpConnectionsAccepted(@NonNull Long httpConnectionsAccepted) Sets the total number of accepted HTTP connections.- Parameters:
httpConnectionsAccepted- total accepted HTTP connections- Returns:
- this builder
-
httpConnectionsRejected
public @NonNull MetricsCollector.Snapshot.Builder httpConnectionsRejected(@NonNull Long httpConnectionsRejected) Sets the total number of rejected HTTP connections.- Parameters:
httpConnectionsRejected- total rejected HTTP connections- Returns:
- this builder
-
sseConnectionsAccepted
public @NonNull MetricsCollector.Snapshot.Builder sseConnectionsAccepted(@NonNull Long sseConnectionsAccepted) Sets the total number of accepted SSE connections.- Parameters:
sseConnectionsAccepted- total accepted SSE connections- Returns:
- this builder
-
sseConnectionsRejected
public @NonNull MetricsCollector.Snapshot.Builder sseConnectionsRejected(@NonNull Long sseConnectionsRejected) Sets the total number of rejected SSE connections.- Parameters:
sseConnectionsRejected- total rejected SSE connections- Returns:
- this builder
-
httpRequestReadFailures
public @NonNull MetricsCollector.Snapshot.Builder httpRequestReadFailures(@Nullable Map<@NonNull MetricsCollector.RequestReadFailureKey, @NonNull Long> httpRequestReadFailures) Sets HTTP request read failure counters keyed by failure reason.- Parameters:
httpRequestReadFailures- the HTTP request read failure counters- Returns:
- this builder
-
httpRequestRejections
public @NonNull MetricsCollector.Snapshot.Builder httpRequestRejections(@Nullable Map<@NonNull MetricsCollector.RequestRejectionKey, @NonNull Long> httpRequestRejections) Sets HTTP request rejection counters keyed by rejection reason.- Parameters:
httpRequestRejections- the HTTP request rejection counters- Returns:
- this builder
-
sseRequestReadFailures
public @NonNull MetricsCollector.Snapshot.Builder sseRequestReadFailures(@Nullable Map<@NonNull MetricsCollector.RequestReadFailureKey, @NonNull Long> sseRequestReadFailures) Sets SSE request read failure counters keyed by failure reason.- Parameters:
sseRequestReadFailures- the SSE request read failure counters- Returns:
- this builder
-
sseRequestRejections
public @NonNull MetricsCollector.Snapshot.Builder sseRequestRejections(@Nullable Map<@NonNull MetricsCollector.RequestRejectionKey, @NonNull Long> sseRequestRejections) Sets SSE request rejection counters keyed by rejection reason.- Parameters:
sseRequestRejections- the SSE request rejection counters- Returns:
- this builder
-
httpRequestDurations
public @NonNull MetricsCollector.Snapshot.Builder httpRequestDurations(@Nullable Map<@NonNull MetricsCollector.ServerRouteStatusKey, @NonNull MetricsCollector.HistogramSnapshot> httpRequestDurations) Sets HTTP request duration histograms keyed by server route and status class.- Parameters:
httpRequestDurations- the HTTP request duration histograms- Returns:
- this builder
-
httpHandlerDurations
public @NonNull MetricsCollector.Snapshot.Builder httpHandlerDurations(@Nullable Map<@NonNull MetricsCollector.ServerRouteStatusKey, @NonNull MetricsCollector.HistogramSnapshot> httpHandlerDurations) Sets HTTP handler duration histograms keyed by server route and status class.- Parameters:
httpHandlerDurations- the HTTP handler duration histograms- Returns:
- this builder
-
httpTimeToFirstByte
public @NonNull MetricsCollector.Snapshot.Builder httpTimeToFirstByte(@Nullable Map<@NonNull MetricsCollector.ServerRouteStatusKey, @NonNull MetricsCollector.HistogramSnapshot> httpTimeToFirstByte) Sets HTTP time-to-first-byte histograms keyed by server route and status class.- Parameters:
httpTimeToFirstByte- the HTTP time-to-first-byte histograms- Returns:
- this builder
-
httpRequestBodyBytes
public @NonNull MetricsCollector.Snapshot.Builder httpRequestBodyBytes(@Nullable Map<@NonNull MetricsCollector.ServerRouteKey, @NonNull MetricsCollector.HistogramSnapshot> httpRequestBodyBytes) Sets HTTP request body size histograms keyed by server route.- Parameters:
httpRequestBodyBytes- the HTTP request body size histograms- Returns:
- this builder
-
httpResponseBodyBytes
public @NonNull MetricsCollector.Snapshot.Builder httpResponseBodyBytes(@Nullable Map<@NonNull MetricsCollector.ServerRouteStatusKey, @NonNull MetricsCollector.HistogramSnapshot> httpResponseBodyBytes) Sets HTTP response body size histograms keyed by server route and status class.- Parameters:
httpResponseBodyBytes- the HTTP response body size histograms- Returns:
- this builder
-
sseHandshakesAccepted
public @NonNull MetricsCollector.Snapshot.Builder sseHandshakesAccepted(@Nullable Map<@NonNull MetricsCollector.ServerSentEventRouteKey, @NonNull Long> sseHandshakesAccepted) Sets SSE handshake acceptance counters keyed by route.- Parameters:
sseHandshakesAccepted- SSE handshake acceptance counters- Returns:
- this builder
-
sseHandshakesRejected
public @NonNull MetricsCollector.Snapshot.Builder sseHandshakesRejected(@Nullable Map<@NonNull MetricsCollector.ServerSentEventRouteHandshakeFailureKey, @NonNull Long> sseHandshakesRejected) Sets SSE handshake rejection counters keyed by route and failure reason.- Parameters:
sseHandshakesRejected- SSE handshake rejection counters- Returns:
- this builder
-
sseEventEnqueueOutcomes
public @NonNull MetricsCollector.Snapshot.Builder sseEventEnqueueOutcomes(@Nullable Map<@NonNull MetricsCollector.ServerSentEventRouteEnqueueOutcomeKey, @NonNull Long> sseEventEnqueueOutcomes) Sets SSE event enqueue outcome counters keyed by route and outcome.- Parameters:
sseEventEnqueueOutcomes- the SSE event enqueue outcome counters- Returns:
- this builder
-
sseCommentEnqueueOutcomes
public @NonNull MetricsCollector.Snapshot.Builder sseCommentEnqueueOutcomes(@Nullable Map<@NonNull MetricsCollector.ServerSentEventCommentRouteEnqueueOutcomeKey, @NonNull Long> sseCommentEnqueueOutcomes) Sets SSE comment enqueue outcome counters keyed by route, comment type, and outcome.- Parameters:
sseCommentEnqueueOutcomes- the SSE comment enqueue outcome counters- Returns:
- this builder
-
sseEventDrops
public @NonNull MetricsCollector.Snapshot.Builder sseEventDrops(@Nullable Map<@NonNull MetricsCollector.ServerSentEventRouteDropKey, @NonNull Long> sseEventDrops) Sets SSE event drop counters keyed by route and drop reason.- Parameters:
sseEventDrops- the SSE event drop counters- Returns:
- this builder
-
sseCommentDrops
public @NonNull MetricsCollector.Snapshot.Builder sseCommentDrops(@Nullable Map<@NonNull MetricsCollector.ServerSentEventCommentRouteDropKey, @NonNull Long> sseCommentDrops) Sets SSE comment drop counters keyed by route, comment type, and drop reason.- Parameters:
sseCommentDrops- the SSE comment drop counters- Returns:
- this builder
-
sseTimeToFirstEvent
public @NonNull MetricsCollector.Snapshot.Builder sseTimeToFirstEvent(@Nullable Map<@NonNull MetricsCollector.ServerSentEventRouteKey, @NonNull MetricsCollector.HistogramSnapshot> sseTimeToFirstEvent) Sets SSE time-to-first-event histograms keyed by route.- Parameters:
sseTimeToFirstEvent- the SSE time-to-first-event histograms- Returns:
- this builder
-
sseEventWriteDurations
public @NonNull MetricsCollector.Snapshot.Builder sseEventWriteDurations(@Nullable Map<@NonNull MetricsCollector.ServerSentEventRouteKey, @NonNull MetricsCollector.HistogramSnapshot> sseEventWriteDurations) Sets SSE event write duration histograms keyed by route.- Parameters:
sseEventWriteDurations- the SSE event write duration histograms- Returns:
- this builder
-
sseEventDeliveryLag
public @NonNull MetricsCollector.Snapshot.Builder sseEventDeliveryLag(@Nullable Map<@NonNull MetricsCollector.ServerSentEventRouteKey, @NonNull MetricsCollector.HistogramSnapshot> sseEventDeliveryLag) Sets SSE event delivery lag histograms keyed by route.- Parameters:
sseEventDeliveryLag- the SSE event delivery lag histograms- Returns:
- this builder
-
sseEventSizes
public @NonNull MetricsCollector.Snapshot.Builder sseEventSizes(@Nullable Map<@NonNull MetricsCollector.ServerSentEventRouteKey, @NonNull MetricsCollector.HistogramSnapshot> sseEventSizes) Sets SSE event size histograms keyed by route.- Parameters:
sseEventSizes- the SSE event size histograms- Returns:
- this builder
-
sseQueueDepth
public @NonNull MetricsCollector.Snapshot.Builder sseQueueDepth(@Nullable Map<@NonNull MetricsCollector.ServerSentEventRouteKey, @NonNull MetricsCollector.HistogramSnapshot> sseQueueDepth) Sets SSE queue depth histograms keyed by route.- Parameters:
sseQueueDepth- the SSE queue depth histograms- Returns:
- this builder
-
sseCommentDeliveryLag
public @NonNull MetricsCollector.Snapshot.Builder sseCommentDeliveryLag(@Nullable Map<@NonNull MetricsCollector.ServerSentEventCommentRouteKey, @NonNull MetricsCollector.HistogramSnapshot> sseCommentDeliveryLag) Sets SSE comment delivery lag histograms keyed by route and comment type.- Parameters:
sseCommentDeliveryLag- the SSE comment delivery lag histograms- Returns:
- this builder
-
sseCommentSizes
public @NonNull MetricsCollector.Snapshot.Builder sseCommentSizes(@Nullable Map<@NonNull MetricsCollector.ServerSentEventCommentRouteKey, @NonNull MetricsCollector.HistogramSnapshot> sseCommentSizes) Sets SSE comment size histograms keyed by route and comment type.- Parameters:
sseCommentSizes- the SSE comment size histograms- Returns:
- this builder
-
sseCommentQueueDepth
public @NonNull MetricsCollector.Snapshot.Builder sseCommentQueueDepth(@Nullable Map<@NonNull MetricsCollector.ServerSentEventCommentRouteKey, @NonNull MetricsCollector.HistogramSnapshot> sseCommentQueueDepth) Sets SSE comment queue depth histograms keyed by route and comment type.- Parameters:
sseCommentQueueDepth- the SSE comment queue depth histograms- Returns:
- this builder
-
sseConnectionDurations
public @NonNull MetricsCollector.Snapshot.Builder sseConnectionDurations(@Nullable Map<@NonNull MetricsCollector.ServerSentEventRouteTerminationKey, @NonNull MetricsCollector.HistogramSnapshot> sseConnectionDurations) Sets SSE connection duration histograms keyed by route and termination reason.- Parameters:
sseConnectionDurations- the SSE connection duration histograms- Returns:
- this builder
-
build
Builds aMetricsCollector.Snapshotinstance.- Returns:
- the built snapshot
-