LabResourceDeviceMonitor
public
class
LabResourceDeviceMonitor
extends LabResourceServiceGrpc.LabResourceServiceImplBase
implements
IDeviceMonitor
| java.lang.Object | ||
| ↳ | com.google.dualhomelab.monitoringagent.resourcemonitoring.LabResourceServiceGrpc.LabResourceServiceImplBase | |
| ↳ | com.android.tradefed.monitoring.LabResourceDeviceMonitor | |
Es 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
|
String |
DEVICE_SERIAL_KEY
|
float |
FIXED_METRIC_VALUE
|
String |
HARDWARE_REVISION_RESOURCE_NAME
|
String |
HARNESS_VERSION_KEY
|
String |
HOST_GROUP_KEY
|
String |
HOST_NAME_KEY
|
String |
LAB_NAME_KEY
|
String |
POOL_ATTRIBUTE_NAME
|
String |
RUN_TARGET_ATTRIBUTE_NAME
|
String |
STATUS_RESOURCE_NAME
|
String |
TEST_HARNESS_KEY
|
Constructores públicos | |
|---|---|
LabResourceDeviceMonitor()
|
|
Métodos públicos | |
|---|---|
void
|
getLabResource(LabResourceRequest request, StreamObserver<LabResource> responseObserver)
Es el controlador de solicitudes de gRPC. |
void
|
notifyDeviceStateChange(String serial, DeviceAllocationState oldState, DeviceAllocationState newState)
Indica al |
void
|
run()
Es un método que se llamará después de que se hayan establecido todos los campos @Option del Monitor. |
void
|
setDeviceLister(IDeviceMonitor.DeviceLister lister)
Permite establecer el |
void
|
stop()
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)
DEVICE_SERIAL_KEY
public static final String DEVICE_SERIAL_KEY
Valor constante: "device_serial"
FIXED_METRIC_VALUE
public static final float FIXED_METRIC_VALUE
Valor constante: 1.0
HARDWARE_REVISION_RESOURCE_NAME
public static final String HARDWARE_REVISION_RESOURCE_NAME
Valor de la constante: "hardware_revision"
HARNESS_VERSION_KEY
public static final String HARNESS_VERSION_KEY
Valor de la constante: "harness_version"
HOST_GROUP_KEY
public static final String HOST_GROUP_KEY
Valor de la constante: "host_group"
HOST_NAME_KEY
public static final String HOST_NAME_KEY
Valor de la constante: "hostname"
LAB_NAME_KEY
public static final String LAB_NAME_KEY
Valor de la constante: "lab_name"
POOL_ATTRIBUTE_NAME
public static final String POOL_ATTRIBUTE_NAME
Valor de la constante: "pool"
RUN_TARGET_ATTRIBUTE_NAME
public static final String RUN_TARGET_ATTRIBUTE_NAME
Valor de la constante: "run_target"
STATUS_RESOURCE_NAME
public static final String STATUS_RESOURCE_NAME
Valor de la constante: "status"
TEST_HARNESS_KEY
public static final String TEST_HARNESS_KEY
Valor de la constante: "test_harness"
Constructores públicos
LabResourceDeviceMonitor
public LabResourceDeviceMonitor ()
Métodos públicos
getLabResource
public void getLabResource (LabResourceRequest request,
StreamObserver<LabResource> responseObserver)Es el controlador de solicitudes de gRPC.
| Parámetros | |
|---|---|
request |
LabResourceRequest |
responseObserver |
StreamObserver |
notifyDeviceStateChange
public void notifyDeviceStateChange (String serial,
DeviceAllocationState oldState,
DeviceAllocationState newState)Indica al IDeviceMonitor que se cambió el estado de un dispositivo.
Las implementaciones de Monitor deben limitar la cantidad de procesamiento y la interacción con IDeviceManager/DeviceLister que realizan en este método.
| Parámetros | |
|---|---|
serial |
String |
oldState |
DeviceAllocationState |
newState |
DeviceAllocationState |
run
public void run ()
Es un método 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 el DeviceLister. Después de un intento exitoso de configurar el objeto Lister, las implementaciones pueden descartar todos los intentos posteriores.
| Parámetros | |
|---|---|
lister |
IDeviceMonitor.DeviceLister |
escala
public void stop ()
Método al que se llamará cuando se deba detener el Monitor.
Métodos protegidos
getCachedLabResource
protected LabResource getCachedLabResource ()
| Muestra | |
|---|---|
LabResource |
|