Documentation ¶
Overview ¶
Package resourceutil provides the information of resource usage of local device
Package resourceutil provides the information of resource usage of local device
Index ¶
Constants ¶
View Source
const ( // CPUUsage defined cpu/usage CPUUsage = "cpu/usage" // CPUCount defined cpu/count CPUCount = "cpu/count" // CPUFreq defined cpu/freq CPUFreq = "cpu/freq" // MemFree defined memory/free MemFree = "memory/free" // MemAvailable defined memory/available MemAvailable = "memory/available" // NetMBps defined network/mbps NetMBps = "network/mbps" // NetBandwidth defined network/bandwidth NetBandwidth = "network/bandwidth" // NetRTT defined network/rtt NetRTT = "network/rtt" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GetResource ¶
GetResource is an interface to get resource
type Monitor ¶
type Monitor interface {
StartMonitoringResource()
}
Monitor is an interface to get device resource
type MonitorImpl ¶
type MonitorImpl struct {
// contains filtered or unexported fields
}
MonitorImpl is implementation for Monitor interface
func GetMonitoringInstance ¶
func GetMonitoringInstance() *MonitorImpl
GetMonitoringInstance return MonitorImpl instance
func (MonitorImpl) StartMonitoringResource ¶
func (m MonitorImpl) StartMonitoringResource()
StartMonitoringResource to get device resources
type ResourceImpl ¶
type ResourceImpl struct {
// contains filtered or unexported fields
}
ResourceImpl is implementation for resourceutil interface
func (*ResourceImpl) GetResource ¶
func (r *ResourceImpl) GetResource(resourceName string) (float64, error)
GetResource returns a resource value that matches resourceName
func (*ResourceImpl) SetDeviceID ¶
func (r *ResourceImpl) SetDeviceID(ID string)
SetDeviceID set target device's id for RTT
Click to show internal directories.
Click to hide internal directories.