Class MetricRecorder


  • @ExperimentalApi("https://github.com/grpc/grpc-java/issues/9006")
    public final class MetricRecorder
    extends Object
    Implements the service/APIs for Out-of-Band metrics reporting, only for utilization metrics. A user should use the public set-APIs to update the server machine's utilization metrics data.
    • Method Detail

      • putUtilizationMetric

        public void putUtilizationMetric​(String key,
                                         double value)
        Update the metrics value in the range [0, 1] corresponding to the specified key. Values outside the valid range are ignored.
      • setAllUtilizationMetrics

        public void setAllUtilizationMetrics​(Map<String,​Double> metrics)
        Replace the whole metrics data using the specified map. No range validation.
      • removeUtilizationMetric

        public void removeUtilizationMetric​(String key)
        Remove the metrics data entry corresponding to the specified key.
      • setCpuUtilizationMetric

        public void setCpuUtilizationMetric​(double value)
        Update the CPU utilization metrics data in the range [0, inf). Values outside the valid range are ignored.
      • clearCpuUtilizationMetric

        public void clearCpuUtilizationMetric()
        Clear the CPU utilization metrics data.
      • setApplicationUtilizationMetric

        public void setApplicationUtilizationMetric​(double value)
        Update the application specific utilization metrics data in the range [0, inf). Values outside the valid range are ignored.
      • clearApplicationUtilizationMetric

        public void clearApplicationUtilizationMetric()
        Clear the application specific utilization metrics data.
      • setMemoryUtilizationMetric

        public void setMemoryUtilizationMetric​(double value)
        Update the memory utilization metrics data in the range [0, 1]. Values outside the valid range are ignored.
      • clearMemoryUtilizationMetric

        public void clearMemoryUtilizationMetric()
        Clear the memory utilization metrics data.
      • setQpsMetric

        public void setQpsMetric​(double value)
        Update the QPS metrics data in the range [0, inf). Values outside the valid range are ignored.
      • clearQpsMetric

        public void clearQpsMetric()
        Clear the QPS metrics data.
      • setEpsMetric

        public void setEpsMetric​(double value)
        Update the EPS metrics data in the range [0, inf). Values outside the valid range are ignored.
      • clearEpsMetric

        public void clearEpsMetric()
        Clear the EPS metrics data.