LabResourceDeviceMonitor

public class LabResourceDeviceMonitor
extends LabResourceServiceGrpc.LabResourceServiceImplBase implements IDeviceMonitor

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


Moniteur de ressources de laboratoire qui initialise/gère le serveur gRPC pour LabResourceService. Pour ajouter des collecteurs de métriques de ressources, veuillez ajouter des balises resource_metric_collector dans la configuration globale pour charger les collecteurs.

Résumé

Constantes

int DEFAULT_PORT

int DEFAULT_THREAD_COUNT

float FIXED_METRIC_VALUE

Des champs

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

Constructeurs publics

LabResourceDeviceMonitor ()

Méthodes publiques

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

Le gestionnaire de requêtes gRPC.

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

Signale à IDeviceMonitor qu’un état de périphérique a été modifié.

void run ()

Une méthode qui sera appelée une fois que tous les champs @Option du moniteur auront été définis.

void setDeviceLister ( IDeviceMonitor.DeviceLister lister)

Permet de définir le DeviceLister .

void stop ()

Une méthode qui sera appelée lorsque le moniteur devra être arrêté.

Méthodes protégées

LabResource getCachedLabResource ()

Constantes

DEFAULT_PORT

public static final int DEFAULT_PORT

Valeur constante : 8887 (0x000022b7)

DEFAULT_THREAD_COUNT

public static final int DEFAULT_THREAD_COUNT

Valeur constante : 1 (0x00000001)

FIXED_METRIC_VALUE

public static final float FIXED_METRIC_VALUE

Valeur constante : 1,0

Des champs

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

Constructeurs publics

LabResourceDeviceMonitor

public LabResourceDeviceMonitor ()

Méthodes publiques

getLabResource

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

Le gestionnaire de requêtes gRPC.

Paramètres
request LabResourceRequest

responseObserver StreamObserver

notifyDeviceStateChange

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

Signale à IDeviceMonitor qu’un état de périphérique a été modifié. Les implémentations de Monitor doivent limiter la quantité de traitement et l’interaction IDeviceManager/DeviceLister qu’elles effectuent dans cette méthode.

Paramètres
serial String

oldState DeviceAllocationState

newState DeviceAllocationState

courir

public void run ()

Une méthode qui sera appelée une fois que tous les champs @Option du moniteur auront été définis.

setDeviceLister

public void setDeviceLister (IDeviceMonitor.DeviceLister lister)

Permet de définir le DeviceLister . Après une tentative réussie de définition du Lister, les implémentations peuvent rejeter toutes les tentatives ultérieures.

Paramètres
lister IDeviceMonitor.DeviceLister

arrêt

public void stop ()

Une méthode qui sera appelée lorsque le moniteur devra être arrêté.

Méthodes protégées

getCachedLabResource

protected LabResource getCachedLabResource ()

Retour
LabResource