Class McpMetricsSnapshot
java.lang.Object
com.soklet.McpMetricsSnapshot
Immutable aggregate of collected MCP metrics.
An empty instance permits the shared MetricsCollector.Snapshot
attachment to remain non-null when no MCP metrics have been observed. The
fixed core families deliberately expose no generic label map; applications
that construct custom event values remain responsible for the
confidentiality and cardinality of those values.
- Author:
- Mark Allen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder for immutableMcpMetricsSnapshotinstances.static final classKey for endpoint-and-method counter aggregates.static final classKey for completed-request and request-duration aggregates.static final classKey for request-stream duration aggregates.static final classImmutable subscription-maintenance aggregate dimensions, shared across supported MCP revisions.static final classKey for subscription-duration aggregates. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Vends a builder for an MCP metrics snapshot.static @NonNull McpMetricsSnapshotReturns the shared snapshot containing zero or empty MCP metric values.Returns the number of occupied MCP application-handler execution slots.Returns the number of currently active admitted MCP requests.Returns the number of currently active MCP request streams.Returns the number of currently active MCP subscriptions.Returns cooperative request-cancelation signals grouped by bounded endpoint and method dimensions.Returns the number of successfully accepted MCP connections admitted within the configured connection-capacity bound.Returns the number of MCP connections rejected because the configured connection-capacity bound was full.Returns the number of MCP application requests rejected because the bounded handler queue was full.Returns the number of MCP application requests waiting for a handler slot.Returns the number of MCP keep-alive comments accepted for delivery.Returns progress notifications accepted for delivery grouped by bounded endpoint and method dimensions.Returns client-visible MCP protocol errors grouped by error code.@NonNull Map<@NonNull McpMetricsSnapshot.RequestOutcomeKey, @NonNull MetricsCollector.HistogramSnapshot> Returns request-duration histograms grouped by bounded endpoint, method, and terminal outcome dimensions.Returns nonnegative completed-request counts grouped by bounded endpoint, method, and terminal outcome dimensions.Returns the number of MCP requests accepted by the bounded protocol processor.Returns the number of MCP requests rejected before admitted semantic handling.@NonNull Map<@NonNull McpMetricsSnapshot.RequestStreamTerminationKey, @NonNull MetricsCollector.HistogramSnapshot> Returns request-stream duration histograms grouped by bounded endpoint, method, and fixed termination reason dimensions.Returns the number of successful MCP server starts.Returns nonnegative server-stop counts grouped by fixed shutdown disposition.@NonNull Map<@NonNull McpMetricsSnapshot.SubscriptionTerminationKey, @NonNull MetricsCollector.HistogramSnapshot> Returns subscription-duration histograms grouped by bounded endpoint and fixed termination reason dimensions.Returns delivered subscription-maintenance event counts grouped by bounded endpoint, fixed work and fixed outcome dimensions across supported MCP revisions.Returns nonnegative MCP transport-failure counts grouped by fixed reason.Returns unknown mirrored-header occurrences grouped by bounded endpoint and method dimensions.
-
Method Details
-
emptyInstance
Returns the shared snapshot containing zero or empty MCP metric values.- Returns:
- empty MCP metrics snapshot
-
builder
Vends a builder for an MCP metrics snapshot.- Returns:
- MCP metrics snapshot builder
-
getActiveHandlerExecutions
Returns the number of occupied MCP application-handler execution slots.- Returns:
- active handler executions
-
getHandlerQueueDepth
Returns the number of MCP application requests waiting for a handler slot.- Returns:
- handler queue depth
-
getHandlerCapacityRejections
Returns the number of MCP application requests rejected because the bounded handler queue was full.- Returns:
- handler capacity rejections
-
getServerStops
Returns nonnegative server-stop counts grouped by fixed shutdown disposition.- Returns:
- immutable, enum-ordered server-stop counts
-
getConnectionsAccepted
Returns the number of successfully accepted MCP connections admitted within the configured connection-capacity bound.- Returns:
- accepted MCP connections
-
getConnectionsRejected
Returns the number of MCP connections rejected because the configured connection-capacity bound was full.- Returns:
- rejected MCP connections
-
getTransportFailures
public @NonNull Map<@NonNull MetricsCollector.TransportFailureReason, @NonNull Long> getTransportFailures()Returns nonnegative MCP transport-failure counts grouped by fixed reason.- Returns:
- immutable, enum-ordered MCP transport-failure counts
-
getServerStarts
Returns the number of successful MCP server starts.- Returns:
- successful MCP server starts
-
getRequestsAccepted
Returns the number of MCP requests accepted by the bounded protocol processor. Processor acceptance can precede a later pre-admission rejection, so this count is independent ofgetRequestsRejected().- Returns:
- accepted MCP requests
-
getRequestsRejected
Returns the number of MCP requests rejected before admitted semantic handling. This count is not the complement ofgetRequestsAccepted().- Returns:
- rejected MCP requests
-
getActiveRequests
Returns the number of currently active admitted MCP requests.- Returns:
- active admitted MCP requests
-
getRequests
Returns nonnegative completed-request counts grouped by bounded endpoint, method, and terminal outcome dimensions.- Returns:
- immutable completed-request counts
-
getRequestDurations
public @NonNull Map<@NonNull McpMetricsSnapshot.RequestOutcomeKey, @NonNull MetricsCollector.HistogramSnapshot> getRequestDurations()Returns request-duration histograms grouped by bounded endpoint, method, and terminal outcome dimensions.- Returns:
- immutable request-duration histograms
-
getActiveRequestStreams
Returns the number of currently active MCP request streams.- Returns:
- active MCP request streams
-
getRequestStreamDurations
public @NonNull Map<@NonNull McpMetricsSnapshot.RequestStreamTerminationKey, @NonNull MetricsCollector.HistogramSnapshot> getRequestStreamDurations()Returns request-stream duration histograms grouped by bounded endpoint, method, and fixed termination reason dimensions.- Returns:
- immutable request-stream duration histograms
-
getActiveSubscriptions
Returns the number of currently active MCP subscriptions.- Returns:
- active MCP subscriptions
-
getSubscriptionDurations
public @NonNull Map<@NonNull McpMetricsSnapshot.SubscriptionTerminationKey, @NonNull MetricsCollector.HistogramSnapshot> getSubscriptionDurations()Returns subscription-duration histograms grouped by bounded endpoint and fixed termination reason dimensions.- Returns:
- immutable subscription-duration histograms
-
getSubscriptionMaintenance
public @NonNull Map<@NonNull McpMetricsSnapshot.SubscriptionMaintenanceKey, @NonNull Long> getSubscriptionMaintenance()Returns delivered subscription-maintenance event counts grouped by bounded endpoint, fixed work and fixed outcome dimensions across supported MCP revisions. Counts include coalescing and stale-result discards; they do not measure unique subscriptions, started attempts, durations or active work.- Returns:
- immutable subscription-maintenance event counts
-
getCancelationsSignaled
public @NonNull Map<@NonNull McpMetricsSnapshot.EndpointMethodKey, @NonNull Long> getCancelationsSignaled()Returns cooperative request-cancelation signals grouped by bounded endpoint and method dimensions.- Returns:
- immutable cancelation-signaled counts
-
getProgressEmitted
public @NonNull Map<@NonNull McpMetricsSnapshot.EndpointMethodKey, @NonNull Long> getProgressEmitted()Returns progress notifications accepted for delivery grouped by bounded endpoint and method dimensions.- Returns:
- immutable progress-emitted counts
-
getKeepAlivesEmitted
Returns the number of MCP keep-alive comments accepted for delivery.- Returns:
- keep-alive comments accepted for delivery
-
getProtocolErrors
-
getUnknownMirroredHeaders
public @NonNull Map<@NonNull McpMetricsSnapshot.EndpointMethodKey, @NonNull Long> getUnknownMirroredHeaders()Returns unknown mirrored-header occurrences grouped by bounded endpoint and method dimensions.- Returns:
- immutable unknown mirrored-header counts
-