LabResourceDeviceMonitor
public
class
LabResourceDeviceMonitor
extends LabResourceServiceGrpc.LabResourceServiceImplBase
implements
IDeviceMonitor
| java.lang.Object | ||
| ↳ | com.google.dualhomelab.monitoringagent.resourcemonitoring.LabResourceServiceGrpc.LabResourceServiceImplBase | |
| ↳ | com.android.tradefed.monitoring.LabResourceDeviceMonitor | |
Il monitor delle risorse del lab che inizializza/gestisce il server gRPC per LabResourceService. Per aggiungere raccoglitori di metriche delle risorse, aggiungi i tag resource_metric_collector nella configurazione globale per caricare i raccoglitori.
Riepilogo
Costanti | |
|---|---|
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
|
Costruttori pubblici | |
|---|---|
LabResourceDeviceMonitor()
|
|
Metodi pubblici | |
|---|---|
void
|
getLabResource(LabResourceRequest request, StreamObserver<LabResource> responseObserver)
Il gestore delle richieste gRPC. |
void
|
notifyDeviceStateChange(String serial, DeviceAllocationState oldState, DeviceAllocationState newState)
Segnala al |
void
|
run()
Un metodo che verrà chiamato dopo l'impostazione di tutti i campi @Option del monitor. |
void
|
setDeviceLister(IDeviceMonitor.DeviceLister lister)
Consente di impostare |
void
|
stop()
Un metodo che verrà chiamato quando il monitor deve essere interrotto. |
Metodi protetti | |
|---|---|
LabResource
|
getCachedLabResource()
|
Costanti
DEFAULT_PORT
public static final int DEFAULT_PORT
Constant Value: 8887 (0x000022b7)
DEFAULT_THREAD_COUNT
public static final int DEFAULT_THREAD_COUNT
Constant Value: 1 (0x00000001)
DEVICE_SERIAL_KEY
public static final String DEVICE_SERIAL_KEY
Constant Value: "device_serial"
FIXED_METRIC_VALUE
public static final float FIXED_METRIC_VALUE
Constant Value: 1.0
HARDWARE_REVISION_RESOURCE_NAME
public static final String HARDWARE_REVISION_RESOURCE_NAME
Constant Value: "hardware_revision"
HARNESS_VERSION_KEY
public static final String HARNESS_VERSION_KEY
Valore costante: "harness_version"
HOST_GROUP_KEY
public static final String HOST_GROUP_KEY
Valore costante: "host_group"
HOST_NAME_KEY
public static final String HOST_NAME_KEY
Valore costante: "hostname"
LAB_NAME_KEY
public static final String LAB_NAME_KEY
Constant Value: "lab_name"
POOL_ATTRIBUTE_NAME
public static final String POOL_ATTRIBUTE_NAME
Valore costante: "pool"
RUN_TARGET_ATTRIBUTE_NAME
public static final String RUN_TARGET_ATTRIBUTE_NAME
Valore costante: "run_target"
STATUS_RESOURCE_NAME
public static final String STATUS_RESOURCE_NAME
Constant Value: "status"
TEST_HARNESS_KEY
public static final String TEST_HARNESS_KEY
Constant Value: "test_harness"
Costruttori pubblici
LabResourceDeviceMonitor
public LabResourceDeviceMonitor ()
Metodi pubblici
getLabResource
public void getLabResource (LabResourceRequest request,
StreamObserver<LabResource> responseObserver)Il gestore delle richieste gRPC.
| Parametri | |
|---|---|
request |
LabResourceRequest |
responseObserver |
StreamObserver |
notifyDeviceStateChange
public void notifyDeviceStateChange (String serial,
DeviceAllocationState oldState,
DeviceAllocationState newState)Segnala al IDeviceMonitor che lo stato di un dispositivo è stato modificato.
Le implementazioni di monitoraggio devono limitare la quantità di elaborazione e
l'interazione IDeviceManager/DeviceLister in questo metodo.
| Parametri | |
|---|---|
serial |
String |
oldState |
DeviceAllocationState |
newState |
DeviceAllocationState |
run
public void run ()
Un metodo che verrà chiamato dopo l'impostazione di tutti i campi @Option del monitor.
setDeviceLister
public void setDeviceLister (IDeviceMonitor.DeviceLister lister)
Consente di impostare DeviceLister. Dopo un tentativo riuscito di impostare l'ascoltatore,
le implementazioni potrebbero ignorare tutti i tentativi successivi.
| Parametri | |
|---|---|
lister |
IDeviceMonitor.DeviceLister |
fermata
public void stop ()
Un metodo che verrà chiamato quando il monitor deve essere interrotto.
Metodi protetti
getCachedLabResource
protected LabResource getCachedLabResource ()
| Ritorni | |
|---|---|
LabResource |
|