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 voidclearApplicationUtilizationMetric()Clear the application specific utilization metrics data.voidclearCpuUtilizationMetric()Clear the CPU utilization metrics data.voidclearEpsMetric()Clear the EPS metrics data.voidclearMemoryUtilizationMetric()Clear the memory utilization metrics data.voidclearQpsMetric()Clear the QPS metrics data.static MetricRecordernewInstance()voidputUtilizationMetric(String key, double value)Update the metrics value in the range [0, 1] corresponding to the specified key.voidremoveUtilizationMetric(String key)Remove the metrics data entry corresponding to the specified key.voidsetAllUtilizationMetrics(Map<String,Double> metrics)Replace the whole metrics data using the specified map.voidsetApplicationUtilizationMetric(double value)Update the application specific utilization metrics data in the range [0, inf).voidsetCpuUtilizationMetric(double value)Update the CPU utilization metrics data in the range [0, inf).voidsetEpsMetric(double value)Update the EPS metrics data in the range [0, inf).voidsetMemoryUtilizationMetric(double value)Update the memory utilization metrics data in the range [0, 1].voidsetQpsMetric(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.
-
-