Package io.grpc.xds.orca
Class OrcaServiceImpl
- java.lang.Object
-
- io.grpc.xds.orca.OrcaServiceImpl
-
- All Implemented Interfaces:
BindableService
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/9006") public final class OrcaServiceImpl extends Object implements BindableService
Implements aBindableServicethat generates Out-Of-Band server metrics. Register the returned service to the server, then a client can request for periodic load reports.
-
-
Field Summary
Fields Modifier and Type Field Description static longDEFAULT_MIN_REPORT_INTERVAL_NANOSEmpty or invalid (non-positive) minInterval config in will be treated to this default value.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ServerServiceDefinitionbindService()CreatesServerServiceDefinitionobject for current instance of service implementation.static BindableServicecreateService(ScheduledExecutorService timeService, MetricRecorder metricRecorder)static BindableServicecreateService(ScheduledExecutorService timeService, MetricRecorder metricsRecorder, long minInterval, TimeUnit timeUnit)Constructs a service to report server metrics.
-
-
-
Method Detail
-
createService
public static BindableService createService(ScheduledExecutorService timeService, MetricRecorder metricsRecorder, long minInterval, TimeUnit timeUnit)
Constructs a service to report server metrics. Config the report interval lower bound, the executor to run the timer, and aMetricRecorderthat contains metrics data.- Parameters:
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.
-
createService
public static BindableService createService(ScheduledExecutorService timeService, MetricRecorder metricRecorder)
-
bindService
public ServerServiceDefinition bindService()
Description copied from interface:BindableServiceCreatesServerServiceDefinitionobject for current instance of service implementation.- Specified by:
bindServicein interfaceBindableService- Returns:
- ServerServiceDefinition object.
-
-