Class GrpcProxyMetrics

java.lang.Object
com.oracle.coherence.grpc.proxy.GrpcProxyMetrics
All Implemented Interfaces:
GrpcProxyMetricsMBean

public class GrpcProxyMetrics extends Object implements GrpcProxyMetricsMBean
The gRPC Proxy metrics MBean implementation.
Author:
Jonathan Knight 2020.10.14
  • Field Details

    • MIN_SNAPSHOT_REFRESH

      public static final long MIN_SNAPSHOT_REFRESH
      The minimum amount of time between request duration histogram snapshots.
      See Also:
  • Constructor Details

  • Method Details

    • addRequestDuration

      public void addRequestDuration(long nanos)
      Add a timing sample to the metrics.
      Parameters:
      nanos - the request time in nanos.
    • addMessageDuration

      public void addMessageDuration(long nanos)
      Add a timing sample to the metrics.
      Parameters:
      nanos - the request time in nanos.
    • markSuccess

      public void markSuccess()
      Update the successful request meter.
    • markError

      public void markError()
      Update the failed request meter.
    • markSent

      public void markSent()
      Update the messages sent meter.
    • markReceived

      public void markReceived()
      Update the messages received meter.
    • getSuccessfulRequestCount

      public long getSuccessfulRequestCount()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the count of requests that responded with success.
      Specified by:
      getSuccessfulRequestCount in interface GrpcProxyMetricsMBean
      Returns:
      the count of requests that responded with success
    • getSuccessfulRequestFifteenMinuteRate

      public double getSuccessfulRequestFifteenMinuteRate()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the fifteen minute rate of successful requests.
      Specified by:
      getSuccessfulRequestFifteenMinuteRate in interface GrpcProxyMetricsMBean
      Returns:
      the fifteen minute rate of successful requests
    • getSuccessfulRequestFiveMinuteRate

      public double getSuccessfulRequestFiveMinuteRate()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the five minute rate of successful requests.
      Specified by:
      getSuccessfulRequestFiveMinuteRate in interface GrpcProxyMetricsMBean
      Returns:
      the five minute rate of successful requests
    • getSuccessfulRequestOneMinuteRate

      public double getSuccessfulRequestOneMinuteRate()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the one minute rate of successful requests.
      Specified by:
      getSuccessfulRequestOneMinuteRate in interface GrpcProxyMetricsMBean
      Returns:
      the one minute rate of successful requests
    • getSuccessfulRequestMeanRate

      public double getSuccessfulRequestMeanRate()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the one minute rate of successful requests.
      Specified by:
      getSuccessfulRequestMeanRate in interface GrpcProxyMetricsMBean
      Returns:
      the one minute rate of successful requests.
    • getErrorRequestCount

      public long getErrorRequestCount()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the count of requests that responded with an error.
      Specified by:
      getErrorRequestCount in interface GrpcProxyMetricsMBean
      Returns:
      the count of requests that responded with an error
    • getErrorRequestFifteenMinuteRate

      public double getErrorRequestFifteenMinuteRate()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the fifteen minute rate of requests that responded with an error.
      Specified by:
      getErrorRequestFifteenMinuteRate in interface GrpcProxyMetricsMBean
      Returns:
      the fifteen minute rate of requests that responded with an error
    • getErrorRequestFiveMinuteRate

      public double getErrorRequestFiveMinuteRate()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the five minute rate of requests that responded with an error.
      Specified by:
      getErrorRequestFiveMinuteRate in interface GrpcProxyMetricsMBean
      Returns:
      the five minute rate of requests that responded with an error
    • getErrorRequestOneMinuteRate

      public double getErrorRequestOneMinuteRate()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the one minute rate of requests that responded with an error.
      Specified by:
      getErrorRequestOneMinuteRate in interface GrpcProxyMetricsMBean
      Returns:
      the one minute rate of requests that responded with an error
    • getErrorRequestMeanRate

      public double getErrorRequestMeanRate()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the mean rate of requests that responded with an error.
      Specified by:
      getErrorRequestMeanRate in interface GrpcProxyMetricsMBean
      Returns:
      the mean rate of requests that responded with an error
    • getRequestDuration75thPercentile

      public double getRequestDuration75thPercentile()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the 75th percentile value from the distribution of samples in the latest snapshot of the request duration metric.
      Specified by:
      getRequestDuration75thPercentile in interface GrpcProxyMetricsMBean
      Returns:
      the 75th percentile value from the distribution of samples in the latest snapshot of the request duration metric.
    • getRequestDuration95thPercentile

      public double getRequestDuration95thPercentile()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the 95th percentile value from the distribution of samples in the latest snapshot of the request duration metric.
      Specified by:
      getRequestDuration95thPercentile in interface GrpcProxyMetricsMBean
      Returns:
      the 95th percentile value from the distribution of samples in the latest snapshot of the request duration metric.
    • getRequestDuration98thPercentile

      public double getRequestDuration98thPercentile()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the 98th percentile value from the distribution of samples in the latest snapshot of the request duration metric.
      Specified by:
      getRequestDuration98thPercentile in interface GrpcProxyMetricsMBean
      Returns:
      the 98th percentile value from the distribution of samples in the latest snapshot of the request duration metric.
    • getRequestDuration99thPercentile

      public double getRequestDuration99thPercentile()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the 99th percentile value from the distribution of samples in the latest snapshot of the request duration metric.
      Specified by:
      getRequestDuration99thPercentile in interface GrpcProxyMetricsMBean
      Returns:
      the 99th percentile value from the distribution of samples in the latest snapshot of the request duration metric.
    • getRequestDuration999thPercentile

      public double getRequestDuration999thPercentile()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the 99.9th percentile value from the distribution of samples in the latest snapshot of the request duration metric.
      Specified by:
      getRequestDuration999thPercentile in interface GrpcProxyMetricsMBean
      Returns:
      the 99.9th percentile value from the distribution of samples in the latest snapshot of the request duration metric.
    • getRequestDurationMax

      public double getRequestDurationMax()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the maximum value from the distribution of samples in the latest snapshot of the request duration metric.
      Specified by:
      getRequestDurationMax in interface GrpcProxyMetricsMBean
      Returns:
      the maximum value from the distribution of samples in the latest snapshot of the request duration metric.
    • getRequestDurationMean

      public double getRequestDurationMean()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the mean value from the distribution of samples in the latest snapshot of the request duration metric.
      Specified by:
      getRequestDurationMean in interface GrpcProxyMetricsMBean
      Returns:
      the mean value from the distribution of samples in the latest snapshot of the request duration metric.
    • getRequestDurationMin

      public double getRequestDurationMin()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the minimum value from the distribution of samples in the latest snapshot of the request duration metric.
      Specified by:
      getRequestDurationMin in interface GrpcProxyMetricsMBean
      Returns:
      the minimum value from the distribution of samples in the latest snapshot of the request duration metric.
    • getRequestDurationStdDev

      public double getRequestDurationStdDev()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the standard deviation from the distribution of samples in the latest snapshot of the request duration metric.
      Specified by:
      getRequestDurationStdDev in interface GrpcProxyMetricsMBean
      Returns:
      the standard deviation from the distribution of samples in the latest snapshot of the request duration metric.
    • getMessageDuration75thPercentile

      public double getMessageDuration75thPercentile()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the 75th percentile value from the distribution of samples in the latest snapshot of the message duration metric.
      Specified by:
      getMessageDuration75thPercentile in interface GrpcProxyMetricsMBean
      Returns:
      the 75th percentile value from the distribution of samples in the latest snapshot of the message duration metric.
    • getMessageDuration95thPercentile

      public double getMessageDuration95thPercentile()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the 95th percentile value from the distribution of samples in the latest snapshot of the message duration metric.
      Specified by:
      getMessageDuration95thPercentile in interface GrpcProxyMetricsMBean
      Returns:
      the 95th percentile value from the distribution of samples in the latest snapshot of the message duration metric.
    • getMessageDuration98thPercentile

      public double getMessageDuration98thPercentile()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the 98th percentile value from the distribution of samples in the latest snapshot of the message duration metric.
      Specified by:
      getMessageDuration98thPercentile in interface GrpcProxyMetricsMBean
      Returns:
      the 98th percentile value from the distribution of samples in the latest snapshot of the message duration metric.
    • getMessageDuration99thPercentile

      public double getMessageDuration99thPercentile()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the 99th percentile value from the distribution of samples in the latest snapshot of the message duration metric.
      Specified by:
      getMessageDuration99thPercentile in interface GrpcProxyMetricsMBean
      Returns:
      the 99th percentile value from the distribution of samples in the latest snapshot of the message duration metric.
    • getMessageDuration999thPercentile

      public double getMessageDuration999thPercentile()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the 99.9th percentile value from the distribution of samples in the latest snapshot of the message duration metric.
      Specified by:
      getMessageDuration999thPercentile in interface GrpcProxyMetricsMBean
      Returns:
      the 99.9th percentile value from the distribution of samples in the latest snapshot of the message duration metric.
    • getMessageDurationMax

      public double getMessageDurationMax()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the maximum value from the distribution of samples in the latest snapshot of the message duration metric.
      Specified by:
      getMessageDurationMax in interface GrpcProxyMetricsMBean
      Returns:
      the maximum value from the distribution of samples in the latest snapshot of the message duration metric.
    • getMessageDurationMean

      public double getMessageDurationMean()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the mean value from the distribution of samples in the latest snapshot of the message duration metric.
      Specified by:
      getMessageDurationMean in interface GrpcProxyMetricsMBean
      Returns:
      the mean value from the distribution of samples in the latest snapshot of the message duration metric.
    • getMessageDurationMin

      public double getMessageDurationMin()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the minimum value from the distribution of samples in the latest snapshot of the message duration metric.
      Specified by:
      getMessageDurationMin in interface GrpcProxyMetricsMBean
      Returns:
      the minimum value from the distribution of samples in the latest snapshot of the message duration metric.
    • getMessageDurationStdDev

      public double getMessageDurationStdDev()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the standard deviation from the distribution of samples in the latest snapshot of the message duration metric.
      Specified by:
      getMessageDurationStdDev in interface GrpcProxyMetricsMBean
      Returns:
      the standard deviation from the distribution of samples in the latest snapshot of the message duration metric.
    • getMessagesReceivedCount

      public long getMessagesReceivedCount()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the count of messages received.
      Specified by:
      getMessagesReceivedCount in interface GrpcProxyMetricsMBean
      Returns:
      the count of messages received
    • getMessagesReceivedFifteenMinuteRate

      public double getMessagesReceivedFifteenMinuteRate()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the fifteen minute rate of messages received.
      Specified by:
      getMessagesReceivedFifteenMinuteRate in interface GrpcProxyMetricsMBean
      Returns:
      the fifteen minute rate of messages received
    • getMessagesReceivedFiveMinuteRate

      public double getMessagesReceivedFiveMinuteRate()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the five minute rate of messages received.
      Specified by:
      getMessagesReceivedFiveMinuteRate in interface GrpcProxyMetricsMBean
      Returns:
      the five minute rate of messages received
    • getMessagesReceivedOneMinuteRate

      public double getMessagesReceivedOneMinuteRate()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the one minute rate of messages received.
      Specified by:
      getMessagesReceivedOneMinuteRate in interface GrpcProxyMetricsMBean
      Returns:
      the one minute rate of messages received
    • getMessagesReceivedMeanRate

      public double getMessagesReceivedMeanRate()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the mean rate of messages received.
      Specified by:
      getMessagesReceivedMeanRate in interface GrpcProxyMetricsMBean
      Returns:
      the mean rate of messages received
    • getResponsesSentCount

      public long getResponsesSentCount()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the count of responses sent.
      Specified by:
      getResponsesSentCount in interface GrpcProxyMetricsMBean
      Returns:
      the count of responses sent
    • getResponsesSentFifteenMinuteRate

      public double getResponsesSentFifteenMinuteRate()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the fifteen minute rate of responses sent.
      Specified by:
      getResponsesSentFifteenMinuteRate in interface GrpcProxyMetricsMBean
      Returns:
      the fifteen minute rate of responses sent
    • getResponsesSentFiveMinuteRate

      public double getResponsesSentFiveMinuteRate()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the five minute rate of responses sent.
      Specified by:
      getResponsesSentFiveMinuteRate in interface GrpcProxyMetricsMBean
      Returns:
      the five minute rate of responses sent
    • getResponsesSentOneMinuteRate

      public double getResponsesSentOneMinuteRate()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the one minute rate of responses sent.
      Specified by:
      getResponsesSentOneMinuteRate in interface GrpcProxyMetricsMBean
      Returns:
      the one minute rate of responses sent
    • getResponsesSentMeanRate

      public double getResponsesSentMeanRate()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the mean rate of responses sent.
      Specified by:
      getResponsesSentMeanRate in interface GrpcProxyMetricsMBean
      Returns:
      the mean rate of responses sent
    • getTaskBacklog

      public int getTaskBacklog()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the number of tasks that have been added to the pool, but not yet scheduled for execution.
      Specified by:
      getTaskBacklog in interface GrpcProxyMetricsMBean
      Returns:
      the number of tasks that have been added to the pool, but not yet scheduled for execution
    • getDaemonCountMax

      public int getDaemonCountMax()
      Description copied from interface: GrpcProxyMetricsMBean
      Returns the maximum number of daemon threads that the pool can create.
      Specified by:
      getDaemonCountMax in interface GrpcProxyMetricsMBean
      Returns:
      the maximum number of daemon threads that the pool can create
    • setDaemonCountMax

      public void setDaemonCountMax(int count)
      Description copied from interface: GrpcProxyMetricsMBean
      Set the maximum daemon pool thread count.
      Specified by:
      setDaemonCountMax in interface GrpcProxyMetricsMBean
      Parameters:
      count - the maximum daemon pool thread count
    • getDaemonCountMin

      public int getDaemonCountMin()
      Description copied from interface: GrpcProxyMetricsMBean
      Returns the minimum number of daemon threads that the pool should have.
      Specified by:
      getDaemonCountMin in interface GrpcProxyMetricsMBean
      Returns:
      the minimum number of daemon threads that the pool should have
    • setDaemonCountMin

      public void setDaemonCountMin(int count)
      Description copied from interface: GrpcProxyMetricsMBean
      Set the minimum daemon pool thread count.
      Specified by:
      setDaemonCountMin in interface GrpcProxyMetricsMBean
      Parameters:
      count - the minimum daemon pool thread count
    • getDaemonCount

      public int getDaemonCount()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the number of Daemon threads that exist, if the pool has been started, or the number of Daemon threads that will be created, if the pool has not yet been started.
      Specified by:
      getDaemonCount in interface GrpcProxyMetricsMBean
      Returns:
      the number of Daemon threads that exist
    • getAbandonedThreadCount

      public int getAbandonedThreadCount()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the total number of abandoned Daemon threads.

      Note: this property is purposely not reset when stats are reset.

      Specified by:
      getAbandonedThreadCount in interface GrpcProxyMetricsMBean
      Returns:
      the total number of abandoned Daemon threads
    • getTaskActiveMillis

      public long getTaskActiveMillis()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the total number of milliseconds spent by all Daemon threads while executing tasks since the last time the statistics were reset.

      Note: this value could be greater then the time elapsed since each daemon adds its own processing time when working in parallel.

      Specified by:
      getTaskActiveMillis in interface GrpcProxyMetricsMBean
      Returns:
      the total number of milliseconds spent by all Daemon threads while executing tasks since the last time the statistics were reset
    • getHungTaskCount

      public int getHungTaskCount()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the total number of currently executing hung tasks.

      Note: this property is purposely not reset when stats are reset.

      Specified by:
      getHungTaskCount in interface GrpcProxyMetricsMBean
      Returns:
      the total number of currently executing hung tasks
    • getHungTaskDuration

      public long getHungTaskDuration()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the longest currently executing hung task duration (in milliseconds).

      Note: this property is purposely not reset when stats are reset.

      Specified by:
      getHungTaskDuration in interface GrpcProxyMetricsMBean
      Returns:
      the longest currently executing hung task duration (in milliseconds)
    • getLastResetMillis

      public long getLastResetMillis()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the last time stats were reset.
      Specified by:
      getLastResetMillis in interface GrpcProxyMetricsMBean
      Returns:
      the last time stats were reset
    • getLastResizeMillis

      public long getLastResizeMillis()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the last time the daemon pool was resized.
      Specified by:
      getLastResizeMillis in interface GrpcProxyMetricsMBean
      Returns:
      the last time the daemon pool was resized
    • getTaskAddCount

      public long getTaskAddCount()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the total number of tasks added to the pool since the last time the statistics were reset.
      Specified by:
      getTaskAddCount in interface GrpcProxyMetricsMBean
      Returns:
      the total number of tasks added to the pool since the last time the statistics were reset
    • getTaskCount

      public long getTaskCount()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the total number of tasks executed by Daemon threads since the last time the statistics were reset.
      Specified by:
      getTaskCount in interface GrpcProxyMetricsMBean
      Returns:
      the total number of tasks executed by Daemon threads since the last time the statistics were reset
    • getMaxTaskBacklog

      public int getMaxTaskBacklog()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the maximum backlog value since the last time the statistics were reset.
      Specified by:
      getMaxTaskBacklog in interface GrpcProxyMetricsMBean
      Returns:
      the maximum backlog value since the last time the statistics were reset
    • getTaskTimeoutCount

      public int getTaskTimeoutCount()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the total number of timed-out tasks since the last time the statistics were reset.
      Specified by:
      getTaskTimeoutCount in interface GrpcProxyMetricsMBean
      Returns:
      the total number of timed-out tasks since the last time the statistics were reset
    • getTaskTimeout

      public long getTaskTimeout()
      Description copied from interface: GrpcProxyMetricsMBean
      Return the default timeout value for PriorityTasks that don't explicitly specify the execution timeout value.
      Specified by:
      getTaskTimeout in interface GrpcProxyMetricsMBean
      Returns:
      the default timeout value for PriorityTasks that don't explicitly specify the execution timeout value
    • registerMBean

      public void registerMBean(Registry registry)
      Registers an MBean for this GrpcProxyMetrics.