Package io.grpc.services
Class MetricRecorder
- java.lang.Object
-
- io.grpc.services.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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearApplicationUtilizationMetric()
Clear the application specific utilization metrics data.void
clearCpuUtilizationMetric()
Clear the CPU utilization metrics data.void
clearEpsMetric()
Clear the EPS metrics data.void
clearMemoryUtilizationMetric()
Clear the memory utilization metrics data.void
clearQpsMetric()
Clear the QPS metrics data.static MetricRecorder
newInstance()
void
putUtilizationMetric(String key, double value)
Update the metrics value in the range [0, 1] corresponding to the specified key.void
removeUtilizationMetric(String key)
Remove the metrics data entry corresponding to the specified key.void
setAllUtilizationMetrics(Map<String,Double> metrics)
Replace the whole metrics data using the specified map.void
setApplicationUtilizationMetric(double value)
Update the application specific utilization metrics data in the range [0, inf).void
setCpuUtilizationMetric(double value)
Update the CPU utilization metrics data in the range [0, inf).void
setEpsMetric(double value)
Update the EPS metrics data in the range [0, inf).void
setMemoryUtilizationMetric(double value)
Update the memory utilization metrics data in the range [0, 1].void
setQpsMetric(double value)
Update the QPS metrics data in the range [0, inf).
-
-
-
Method Detail
-
newInstance
public static MetricRecorder newInstance()
-
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.
-
-