LabResourceDeviceMonitor
public
class
LabResourceDeviceMonitor
extends LabResourceServiceGrpc.LabResourceServiceImplBase
implements
IDeviceMonitor
java.lang.Object | ||
↳ | com.google.dualhomelab.monitoringagent.resourcemonitoring.LabResourceServiceGrpc.LabResourceServiceImplBase | |
↳ | com.android.tradefed.monitoring.LabResourceDeviceMonitor |
El monitor de recursos del lab que inicializa o administra el servidor de gRPC para LabResourceService. Para agregar recopiladores de métricas de recursos, agrega etiquetas resource_metric_collector en la configuración global para cargar los recopiladores.
Resumen
Constantes | |
---|---|
int |
DEFAULT_PORT
|
int |
DEFAULT_THREAD_COUNT
|
float |
FIXED_METRIC_VALUE
|
Campos | |
---|---|
public
static
final
String |
DEVICE_SERIAL_KEY
|
public
static
final
String |
HARDWARE_REVISION_RESOURCE_NAME
|
public
static
final
String |
HARNESS_VERSION_KEY
|
public
static
final
String |
HOST_GROUP_KEY
|
public
static
final
String |
HOST_NAME_KEY
|
public
static
final
String |
LAB_NAME_KEY
|
public
static
final
String |
POOL_ATTRIBUTE_NAME
|
public
static
final
String |
RUN_TARGET_ATTRIBUTE_NAME
|
public
static
final
String |
STATUS_RESOURCE_NAME
|
public
static
final
String |
TEST_HARNESS_KEY
|
Constructores públicos | |
---|---|
LabResourceDeviceMonitor()
|
Métodos públicos | |
---|---|
void
|
getLabResource(LabResourceRequest request, StreamObserver<LabResource> responseObserver)
El controlador de solicitudes de gRPC. |
void
|
notifyDeviceStateChange(String serial, DeviceAllocationState oldState, DeviceAllocationState newState)
Le indica a |
void
|
run()
Es un método al que se llamará después de que se hayan establecido todos los campos @Option del Monitor. |
void
|
setDeviceLister(IDeviceMonitor.DeviceLister lister)
Permite establecer |
void
|
stop()
Es un método al que se llamará cuando se deba detener el Monitor. |
Métodos protegidos | |
---|---|
LabResource
|
getCachedLabResource()
|
Constantes
DEFAULT_PORT
public static final int DEFAULT_PORT
Valor constante: 8887 (0x000022b7)
DEFAULT_THREAD_COUNT
public static final int DEFAULT_THREAD_COUNT
Valor constante: 1 (0x00000001)
FIXED_METRIC_VALUE
public static final float FIXED_METRIC_VALUE
Valor constante: 1.0
Campos
DEVICE_SERIAL_KEY
public static final String DEVICE_SERIAL_KEY
HARDWARE_REVISION_RESOURCE_NAME
public static final String HARDWARE_REVISION_RESOURCE_NAME
HARNESS_VERSION_KEY
public static final String HARNESS_VERSION_KEY
HOST_GROUP_KEY
public static final String HOST_GROUP_KEY
HOST_NAME_KEY
public static final String HOST_NAME_KEY
LAB_NAME_KEY
public static final String LAB_NAME_KEY
POOL_ATTRIBUTE_NAME
public static final String POOL_ATTRIBUTE_NAME
RUN_TARGET_ATTRIBUTE_NAME
public static final String RUN_TARGET_ATTRIBUTE_NAME
STATUS_RESOURCE_NAME
public static final String STATUS_RESOURCE_NAME
TEST_HARNESS_KEY
public static final String TEST_HARNESS_KEY
Constructores públicos
LabResourceDeviceMonitor
public LabResourceDeviceMonitor ()
Métodos públicos
getLabResource
public void getLabResource (LabResourceRequest request, StreamObserver<LabResource> responseObserver)
El controlador de solicitudes de gRPC.
Parámetros | |
---|---|
request |
LabResourceRequest |
responseObserver |
StreamObserver |
notifyDeviceStateChange
public void notifyDeviceStateChange (String serial, DeviceAllocationState oldState, DeviceAllocationState newState)
Indica a IDeviceMonitor
que se cambió el estado de un dispositivo.
Las implementaciones de supervisión deben limitar la cantidad de procesamiento y la interacción de IDeviceManager/DeviceLister que realizan en este método.
Parámetros | |
---|---|
serial |
String |
oldState |
DeviceAllocationState |
newState |
DeviceAllocationState |
run
public void run ()
Es un método al que se llamará después de que se hayan establecido todos los campos @Option del Monitor.
setDeviceLister
public void setDeviceLister (IDeviceMonitor.DeviceLister lister)
Permite establecer DeviceLister
. Después de un intento exitoso de configurar el Lister, las implementaciones pueden descartar todos los intentos posteriores.
Parámetros | |
---|---|
lister |
IDeviceMonitor.DeviceLister |
escala
public void stop ()
Es un método al que se llamará cuando se deba detener el Monitor.
Métodos protegidos
getCachedLabResource
protected LabResource getCachedLabResource ()
Muestra | |
---|---|
LabResource |