resourceutil

package
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

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 Command

type Command interface {
	Run(string) float64
	Close()
}

Command is an interface to control resource monitoring operations

type GetResource

type GetResource interface {
	GetResource(string) (float64, error)
	SetDeviceID(string)
}

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

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL