DeviceUtilStatsMonitor

public class DeviceUtilStatsMonitor
extends Object implements IDeviceMonitor

java.lang.Object
   ↳ com.android.tradefed.device.DeviceUtilStatsMonitor


A IDeviceMonitor that calculates device utilization stats.

Currently measures simple moving average of allocation time % over a 24 hour window.

Summary

Nested classes

enum DeviceUtilStatsMonitor.StubDeviceUtil

Enum for configuring treatment of stub devices when calculating average host utilization  

class DeviceUtilStatsMonitor.UtilizationDesc

Container for utilization stats. 

Public constructors

DeviceUtilStatsMonitor()

Public methods

DeviceUtilStatsMonitor.UtilizationDesc getUtilizationStats()

Get the device utilization up to the last 24 hours

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

Listens to device state changes and records time that device transitions from or to available or allocated state.

void run()

A method that will be called after all of the Monitor's @Option fields have been set.

void setDeviceLister(IDeviceMonitor.DeviceLister lister)

Allows the IDeviceMonitor.DeviceLister to be set.

void stop()

A method that will be called when the Monitor need to be stopped.

Public constructors

DeviceUtilStatsMonitor

DeviceUtilStatsMonitor ()

Public methods

getUtilizationStats

DeviceUtilStatsMonitor.UtilizationDesc getUtilizationStats ()

Get the device utilization up to the last 24 hours

Returns
DeviceUtilStatsMonitor.UtilizationDesc

notifyDeviceStateChange

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

Listens to device state changes and records time that device transitions from or to available or allocated state.

Parameters
serial String

oldState DeviceAllocationState

newState DeviceAllocationState

run

void run ()

A method that will be called after all of the Monitor's @Option fields have been set.

setDeviceLister

void setDeviceLister (IDeviceMonitor.DeviceLister lister)

Allows the IDeviceMonitor.DeviceLister to be set. After a successful attempt to set the Lister, implementations may discard all subsequent attempts.

Parameters
lister IDeviceMonitor.DeviceLister

stop

void stop ()

A method that will be called when the Monitor need to be stopped.