diff options
author | yngveaasheim <yngve@yahooinc.com> | 2023-03-15 14:04:58 +0100 |
---|---|---|
committer | yngveaasheim <yngve@yahooinc.com> | 2023-03-15 14:05:50 +0100 |
commit | bd953ff8a7bd8663415e289d6fd85bdd98b7b2ea (patch) | |
tree | 341d3f63e927125c2e40badeac24dd6595619a66 /container-core/src/main | |
parent | 33118797862c2025aeafdf11422754e6df4396fc (diff) |
Use enums for remaining container metrics.
Diffstat (limited to 'container-core/src/main')
-rw-r--r-- | container-core/src/main/java/com/yahoo/jdisc/http/server/jetty/MetricDefinitions.java | 26 | ||||
-rw-r--r-- | container-core/src/main/java/com/yahoo/metrics/ContainerMetrics.java | 33 |
2 files changed, 44 insertions, 15 deletions
diff --git a/container-core/src/main/java/com/yahoo/jdisc/http/server/jetty/MetricDefinitions.java b/container-core/src/main/java/com/yahoo/jdisc/http/server/jetty/MetricDefinitions.java index 6753fed2c5a..a4eaab2e8f8 100644 --- a/container-core/src/main/java/com/yahoo/jdisc/http/server/jetty/MetricDefinitions.java +++ b/container-core/src/main/java/com/yahoo/jdisc/http/server/jetty/MetricDefinitions.java @@ -22,10 +22,10 @@ class MetricDefinitions { static final String STATUS_CODE_DIMENSION = "statusCode"; static final String NUM_OPEN_CONNECTIONS = ContainerMetrics.SERVER_NUM_OPEN_CONNECTIONS.baseName(); - static final String NUM_CONNECTIONS_OPEN_MAX = "serverConnectionsOpenMax"; - static final String CONNECTION_DURATION_MAX = "serverConnectionDurationMax"; - static final String CONNECTION_DURATION_MEAN = "serverConnectionDurationMean"; - static final String CONNECTION_DURATION_STD_DEV = "serverConnectionDurationStdDev"; + static final String NUM_CONNECTIONS_OPEN_MAX = ContainerMetrics.SERVER_CONNECTIONS_OPEN_MAX.baseName(); + static final String CONNECTION_DURATION_MAX = ContainerMetrics.SERVER_CONNECTION_DURATION_MAX.baseName(); + static final String CONNECTION_DURATION_MEAN = ContainerMetrics.SERVER_CONNECTION_DURATION_MEAN.baseName(); + static final String CONNECTION_DURATION_STD_DEV = ContainerMetrics.SERVER_CONNECTION_DURATION_STD_DEV.baseName(); static final String NUM_PREMATURELY_CLOSED_CONNECTIONS = ContainerMetrics.JDISC_HTTP_REQUEST_PREMATURELY_CLOSED.baseName(); static final String REQUESTS_PER_CONNECTION = ContainerMetrics.JDISC_HTTP_REQUEST_REQUESTS_PER_CONNECTION.baseName(); @@ -36,16 +36,16 @@ class MetricDefinitions { /* For historical reasons, these are all aliases for the same metric. 'jdisc.http' should ideally be the only one. */ static final String JDISC_HTTP_REQUESTS = ContainerMetrics.JDISC_HTTP_REQUESTS.baseName(); - static final String NUM_REQUESTS = "serverNumRequests"; + static final String NUM_REQUESTS = ContainerMetrics.SERVER_NUM_REQUESTS.baseName(); - static final String NUM_SUCCESSFUL_RESPONSES = "serverNumSuccessfulResponses"; - static final String NUM_FAILED_RESPONSES = "serverNumFailedResponses"; - static final String NUM_SUCCESSFUL_WRITES = "serverNumSuccessfulResponseWrites"; - static final String NUM_FAILED_WRITES = "serverNumFailedResponseWrites"; + static final String NUM_SUCCESSFUL_RESPONSES = ContainerMetrics.SERVER_NUM_SUCCESSFUL_RESPONSES.baseName(); + static final String NUM_FAILED_RESPONSES = ContainerMetrics.SERVER_NUM_FAILED_RESPONSES.baseName(); + static final String NUM_SUCCESSFUL_WRITES = ContainerMetrics.SERVER_NUM_SUCCESSFUL_RESPONSE_WRITES.baseName(); + static final String NUM_FAILED_WRITES = ContainerMetrics.SERVER_NUM_FAILED_RESPONSE_WRITES.baseName(); - static final String TOTAL_SUCCESSFUL_LATENCY = "serverTotalSuccessfulResponseLatency"; - static final String TOTAL_FAILED_LATENCY = "serverTotalFailedResponseLatency"; - static final String TIME_TO_FIRST_BYTE = "serverTimeToFirstByte"; + static final String TOTAL_SUCCESSFUL_LATENCY = ContainerMetrics.SERVER_TOTAL_SUCCESFUL_RESPONSE_LATENCY.baseName(); + static final String TOTAL_FAILED_LATENCY = ContainerMetrics.SERVER_TOTAL_FAILED_RESPONSE_LATENCY.baseName(); + static final String TIME_TO_FIRST_BYTE = ContainerMetrics.SERVER_TIME_TO_FIRST_BYTE.baseName(); static final String RESPONSES_1XX = ContainerMetrics.HTTP_STATUS_1XX.baseName(); static final String RESPONSES_2XX = ContainerMetrics.HTTP_STATUS_2XX.baseName(); @@ -53,7 +53,7 @@ class MetricDefinitions { static final String RESPONSES_4XX = ContainerMetrics.HTTP_STATUS_4XX.baseName(); static final String RESPONSES_5XX = ContainerMetrics.HTTP_STATUS_5XX.baseName(); - static final String STARTED_MILLIS = "serverStartedMillis"; + static final String STARTED_MILLIS = ContainerMetrics.SERVER_STARTED_MILLIS.baseName(); static final String URI_LENGTH = ContainerMetrics.JDISC_HTTP_REQUEST_URI_LENGTH.baseName(); static final String CONTENT_SIZE = ContainerMetrics.JDISC_HTTP_REQUEST_CONTENT_SIZE.baseName(); diff --git a/container-core/src/main/java/com/yahoo/metrics/ContainerMetrics.java b/container-core/src/main/java/com/yahoo/metrics/ContainerMetrics.java index ed1d6f7a001..d26e1b72dd7 100644 --- a/container-core/src/main/java/com/yahoo/metrics/ContainerMetrics.java +++ b/container-core/src/main/java/com/yahoo/metrics/ContainerMetrics.java @@ -158,7 +158,7 @@ public enum ContainerMetrics implements VespaMetrics { ERROR_UNSPECIFIED("error.unspecified", Unit.OPERATION, "Requests that failed for an unspecified reason"), ERROR_UNHANDLED_EXCEPTION("error.unhandled_exception", Unit.OPERATION, "Requests that failed due to an unhandled exception"), - // Deprecated metrics. TODO: Remove on Vespa 9. + // Deprecated metrics. TODO: Remove in Vespa 9. SERVER_REJECTED_REQUESTS("serverRejectedRequests", Unit.OPERATION, "Deprecated. Use jdisc.thread_pool.rejected_tasks instead."), SERVER_THREAD_POOL_SIZE("serverThreadPoolSize", Unit.THREAD, "Deprecated. Use jdisc.thread_pool.size instead."), SERVER_ACTIVE_THREADS("serverActiveThreads", Unit.THREAD, "Deprecated. Use jdisc.thread_pool.active_threads instead."), @@ -193,7 +193,36 @@ public enum ContainerMetrics implements VespaMetrics { JRT_TRANSPORT_SERVER_TLS_CONNECIONTS_ESTABLISHED("jrt.transport.server.tls-connections-established", Unit.CONNECTION, "TLS server connections established"), JRT_TRANSPORT_CLIENT_TLS_CONNECTIONS_ESTABLISHED("jrt.transport.client.tls-connections-established", Unit.CONNECTION, "TLS client connections established"), JRT_TRANSPORT_SERVER_UNENCRYPTED_CONNECTIONS_ESTABLISHED("jrt.transport.server.unencrypted-connections-established", Unit.CONNECTION, "Unencrypted server connections established"), - JRT_TRANSPORT_CLIENT_UNENCRYPTED_CONNECTIONS_ESTABLISHED("jrt.transport.client.unencrypted-connections-established", Unit.CONNECTION, "Unencrypted client connections established"); + JRT_TRANSPORT_CLIENT_UNENCRYPTED_CONNECTIONS_ESTABLISHED("jrt.transport.client.unencrypted-connections-established", Unit.CONNECTION, "Unencrypted client connections established"), + + MAX_QUERY_LATENCY("max_query_latency", Unit.MILLISECOND, "Deprecated. Use query_latency.max instead"), // TODO: Remove in Vespa 9 + MEAN_QUERY_LATENCY("mean_query_latency", Unit.MILLISECOND, "Deprecated. Use the expression (query_latency.sum / query_latency.count) instead"),// TODO: Remove in Vespa 9 + + + // Metrics defined in com/yahoo/jdisc/http/filter/security/athenz/AthenzAuthorizationFilter.java + JDISC_HTTP_FILTER_ATHENZ_ACCEPTED_REQUESTS("jdisc.http.filter.athenz.accepted_requests", Unit.REQUEST, "Number of requests accepted by the AthenzAuthorization filter"), + JDISC_HTTP_FILTER_ATHENZ_REJECTED_REQUESTS("jdisc.http.filter.athenz.rejected_requests", Unit.REQUEST, "Number of requests rejected by the AthenzAuthorization filter"), + + + // Metrics defined in com/yahoo/jdisc/http/server/jetty/MetricDefinitions.java + SERVER_CONNECTIONS_OPEN_MAX("serverConnectionsOpenMax", Unit.CONNECTION, "Maximum number of open connections"), + SERVER_CONNECTION_DURATION_MAX("serverConnectionDurationMax", Unit.MILLISECOND, "Longest duration a connection is kept open"), + + SERVER_CONNECTION_DURATION_MEAN("serverConnectionDurationMean", Unit.MILLISECOND, "Average duration a connection is kept open"), + SERVER_CONNECTION_DURATION_STD_DEV("serverConnectionDurationStdDev", Unit.MILLISECOND, "Standard deviation of open connection duration"), + SERVER_NUM_REQUESTS("serverNumRequests", Unit.REQUEST, "Number of requests"), + SERVER_NUM_SUCCESSFUL_RESPONSES("serverNumSuccessfulResponses", Unit.REQUEST, "Number of successful responses"), + SERVER_NUM_FAILED_RESPONSES("serverNumFailedResponses", Unit.REQUEST, "Number of failed responses"), + + SERVER_NUM_SUCCESSFUL_RESPONSE_WRITES("serverNumSuccessfulResponseWrites", Unit.REQUEST, "Number of successful response writes"), + SERVER_NUM_FAILED_RESPONSE_WRITES("serverNumFailedResponseWrites", Unit.REQUEST, "Number of failed response writes"), + + SERVER_TOTAL_SUCCESFUL_RESPONSE_LATENCY("serverTotalSuccessfulResponseLatency", Unit.MILLISECOND, "Total duration for execution of successful responses"), + SERVER_TOTAL_FAILED_RESPONSE_LATENCY("serverTotalFailedResponseLatency", Unit.MILLISECOND, "Total duration for execution of failed responses"), + SERVER_TIME_TO_FIRST_BYTE("serverTimeToFirstByte", Unit.MILLISECOND, "Time from request has been received by the server until the first byte is returned to the client"), + + SERVER_STARTED_MILLIS("serverStartedMillis", Unit.MILLISECOND, "Time since the service was started"); + private final String name; |