LabResourceDeviceMonitor

public class LabResourceDeviceMonitor
extends LabResourceServiceGrpc.LabResourceServiceImplBase implements IDeviceMonitor

java.lang.Object
   ↳ com.google.dualhomelab.monitoringagent.resourcemonitoring.LabResourceServiceGrpc.LabResourceServiceImplBase
     ↳ com.android.tradefed.monitoring.LabResourceDeviceMonitor


Trình giám sát tài nguyên của phòng thí nghiệm khởi chạy/quản lý máy chủ gRPC cho LabResourceService. Để thêm trình thu thập chỉ số tài nguyên, vui lòng thêm thẻ resource_metric_collector trong cấu hình chung để tải trình thu thập.

Tóm tắt

Hằng số

int DEFAULT_PORT

int DEFAULT_THREAD_COUNT

float FIXED_METRIC_VALUE

Trường

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

Hàm khởi tạo công khai

LabResourceDeviceMonitor()

Phương thức công khai

void getLabResource(LabResourceRequest request, StreamObserver<LabResource> responseObserver)

Trình xử lý yêu cầu gRPC.

void notifyDeviceStateChange(String serial, DeviceAllocationState oldState, DeviceAllocationState newState)

Báo hiệu cho IDeviceMonitor rằng trạng thái thiết bị đã thay đổi.

void run()

Một phương thức sẽ được gọi sau khi tất cả các trường @Option của Monitor đã được đặt.

void setDeviceLister(IDeviceMonitor.DeviceLister lister)

Cho phép đặt DeviceLister.

void stop()

Một phương thức sẽ được gọi khi cần dừng Trình theo dõi.

Phương thức được bảo vệ

LabResource getCachedLabResource()

Hằng số

DEFAULT_PORT

public static final int DEFAULT_PORT

Giá trị không đổi: 8887 (0x000022b7)

DEFAULT_THREAD_COUNT

public static final int DEFAULT_THREAD_COUNT

Giá trị không đổi: 1 (0x00000001)

FIXED_METRIC_VALUE

public static final float FIXED_METRIC_VALUE

Giá trị hằng số: 1.0

Trường

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

Hàm khởi tạo công khai

LabResourceDeviceMonitor

public LabResourceDeviceMonitor ()

Phương thức công khai

getLabResource

public void getLabResource (LabResourceRequest request, 
                StreamObserver<LabResource> responseObserver)

Trình xử lý yêu cầu gRPC.

Tham số
request LabResourceRequest

responseObserver StreamObserver

notifyDeviceStateChange

public void notifyDeviceStateChange (String serial, 
                DeviceAllocationState oldState, 
                DeviceAllocationState newState)

Báo hiệu cho IDeviceMonitor rằng trạng thái thiết bị đã thay đổi. Việc triển khai giám sát phải giới hạn lượng dữ liệu xử lý và tương tác IDeviceManager/DeviceLister mà chúng thực hiện trong phương thức này.

Tham số
serial String

oldState DeviceAllocationState

newState DeviceAllocationState

chạy

public void run ()

Một phương thức sẽ được gọi sau khi tất cả các trường @Option của Monitor đã được đặt.

setDeviceLister

public void setDeviceLister (IDeviceMonitor.DeviceLister lister)

Cho phép đặt DeviceLister. Sau khi thiết lập thành công Lister, các hoạt động triển khai có thể loại bỏ tất cả các lần thử tiếp theo.

Tham số
lister IDeviceMonitor.DeviceLister

điểm dừng

public void stop ()

Một phương thức sẽ được gọi khi cần dừng Trình theo dõi.

Phương thức được bảo vệ

getCachedLabResource

protected LabResource getCachedLabResource ()

Giá trị trả về
LabResource