@ExperimentalApi(value="https://github.com/grpc/grpc-java/issues/9006") public final class OrcaOobService extends Object
getService() to the server, then a client can request
for periodic load reports. A user should use the public set-APIs to update the server machine's
utilization metrics data.| Modifier and Type | Field and Description |
|---|---|
static long |
DEFAULT_MIN_REPORT_INTERVAL_NANOS
Empty or invalid (non-positive) minInterval config in will be treated to this default value.
|
| Constructor and Description |
|---|
OrcaOobService(long minInterval,
TimeUnit timeUnit,
ScheduledExecutorService timeService)
Construct an OOB metrics reporting service.
|
OrcaOobService(ScheduledExecutorService timeService) |
| Modifier and Type | Method and Description |
|---|---|
void |
deleteCpuUtilizationMetric()
Clear the CPU utilization metrics data.
|
void |
deleteMemoryUtilizationMetric()
Clear the memory utilization metrics data.
|
void |
deleteUtilizationMetric(String key)
Remove the metrics data entry corresponding to the specified key.
|
BindableService |
getService()
Returns the service instance to be bound to the server for ORCA OOB functionality.
|
void |
setAllUtilizationMetrics(Map<String,Double> metrics)
Replace the whole metrics data using the specified map.
|
void |
setCpuUtilizationMetric(double value)
Update the CPU utilization metrics data.
|
void |
setMemoryUtilizationMetric(double value)
Update the memory utilization metrics data.
|
void |
setUtilizationMetric(String key,
double value)
Update the metrics value corresponding to the specified key.
|
public static final long DEFAULT_MIN_REPORT_INTERVAL_NANOS
public OrcaOobService(long minInterval,
TimeUnit timeUnit,
ScheduledExecutorService timeService)
minInterval - configures the minimum metrics reporting interval for the service. Bad
configuration (non-positive) will be overridden to service default (30s).
Minimum metrics reporting interval means, if the setting in the client's
request is invalid (non-positive) or below this value, they will be treated
as this value.public OrcaOobService(ScheduledExecutorService timeService)
public BindableService getService()
public void setUtilizationMetric(String key, double value)
public void setAllUtilizationMetrics(Map<String,Double> metrics)
public void deleteUtilizationMetric(String key)
public void setCpuUtilizationMetric(double value)
public void deleteCpuUtilizationMetric()
public void setMemoryUtilizationMetric(double value)
public void deleteMemoryUtilizationMetric()