LabResourceDeviceMonitor
public
class
LabResourceDeviceMonitor
extends LabResourceServiceGrpc.LabResourceServiceImplBase
implements
IDeviceMonitor
| java.lang.Object | ||
| ↳ | com.google.dualhomelab.monitoringagent.resourcemonitoring.LabResourceServiceGrpc.LabResourceServiceImplBase | |
| ↳ | com.android.tradefed.monitoring.LabResourceDeviceMonitor | |
הכלי לניטור משאבי המעבדה, שמפעיל ומנהל את שרת ה-gRPC של LabResourceService. כדי להוסיף אוספי מדדים של משאבים, צריך להוסיף תגי resource_metric_collector בהגדרה הגלובלית כדי לטעון את האוספים.
סיכום
ערכים קבועים | |
|---|---|
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
|
Constructors ציבוריים | |
|---|---|
LabResourceDeviceMonitor()
|
|
methods ציבוריים | |
|---|---|
void
|
getLabResource(LabResourceRequest request, StreamObserver<LabResource> responseObserver)
ה-handler של בקשת gRPC. |
void
|
notifyDeviceStateChange(String serial, DeviceAllocationState oldState, DeviceAllocationState newState)
האותות |
void
|
run()
שיטה שתופעל אחרי שכל השדות של Monitor מסוג @Option יוגדרו. |
void
|
setDeviceLister(IDeviceMonitor.DeviceLister lister)
מאפשר להגדיר את |
void
|
stop()
Method שיופעל כשצריך להפסיק את המעקב. |
שיטות מוגנות | |
|---|---|
LabResource
|
getCachedLabResource()
|
ערכים קבועים
DEFAULT_PORT
public static final int DEFAULT_PORT
ערך קבוע: 8887 (0x000022b7)
DEFAULT_THREAD_COUNT
public static final int DEFAULT_THREAD_COUNT
ערך קבוע: 1 (0x00000001)
DEVICE_SERIAL_KEY
public static final String DEVICE_SERIAL_KEY
ערך קבוע: "device_serial"
FIXED_METRIC_VALUE
public static final float FIXED_METRIC_VALUE
ערך קבוע: 1.0
HARDWARE_REVISION_RESOURCE_NAME
public static final String HARDWARE_REVISION_RESOURCE_NAME
ערך קבוע: "hardware_revision"
HARNESS_VERSION_KEY
public static final String HARNESS_VERSION_KEY
ערך קבוע: "harness_version"
HOST_GROUP_KEY
public static final String HOST_GROUP_KEY
ערך קבוע: "host_group"
HOST_NAME_KEY
public static final String HOST_NAME_KEY
ערך קבוע: "hostname"
LAB_NAME_KEY
public static final String LAB_NAME_KEY
ערך קבוע: "lab_name"
POOL_ATTRIBUTE_NAME
public static final String POOL_ATTRIBUTE_NAME
ערך קבוע: "pool"
RUN_TARGET_ATTRIBUTE_NAME
public static final String RUN_TARGET_ATTRIBUTE_NAME
ערך קבוע: "run_target"
STATUS_RESOURCE_NAME
public static final String STATUS_RESOURCE_NAME
ערך קבוע: "status"
TEST_HARNESS_KEY
public static final String TEST_HARNESS_KEY
ערך קבוע: "test_harness"
Constructors ציבוריים
LabResourceDeviceMonitor
public LabResourceDeviceMonitor ()
methods ציבוריים
getLabResource
public void getLabResource (LabResourceRequest request,
StreamObserver<LabResource> responseObserver)ה-handler של בקשת gRPC.
| פרמטרים | |
|---|---|
request |
LabResourceRequest |
responseObserver |
StreamObserver |
notifyDeviceStateChange
public void notifyDeviceStateChange (String serial,
DeviceAllocationState oldState,
DeviceAllocationState newState)האותות IDeviceMonitor שמצב המכשיר השתנה.
הטמעות של Monitor צריכות להגביל את כמות העיבוד והאינטראקציה של IDeviceManager/DeviceLister שהן מבצעות בשיטה הזו.
| פרמטרים | |
|---|---|
serial |
String |
oldState |
DeviceAllocationState |
newState |
DeviceAllocationState |
ראן
public void run ()
שיטה שתופעל אחרי שכל השדות של Monitor מסוג @Option יוגדרו.
setDeviceLister
public void setDeviceLister (IDeviceMonitor.DeviceLister lister)
מאפשר להגדיר את DeviceLister. אחרי ניסיון מוצלח להגדיר את ה-Lister, יכול להיות שההטמעות יבטלו את כל הניסיונות הבאים.
| פרמטרים | |
|---|---|
lister |
IDeviceMonitor.DeviceLister |
עצור
public void stop ()
Method שיופעל כשצריך להפסיק את המעקב.
שיטות מוגנות
getCachedLabResource
protected LabResource getCachedLabResource ()
| החזרות | |
|---|---|
LabResource |
|