Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CpuStats ¶
type CpuStats struct {
// contains filtered or unexported fields
}
CpuStats calculates cpu usage percentage
func (*CpuStats) Percent ¶
Percent calculates the cpu usage percentage based on the current cpu usage and the previous cpu usage where usage is given as time in nanoseconds spend in the cpu
func (*CpuStats) TicksConsumed ¶
TicksConsumed calculates the total ticks consumes by the process across all cpu cores
type DiskStats ¶
type DiskStats struct { Device string Mountpoint string Size uint64 Used uint64 Available uint64 UsedPercent float64 InodesUsedPercent float64 }
DiskStats represents stats related to disk usage
type HostCpuStatsCalculator ¶
type HostCpuStatsCalculator struct {
// contains filtered or unexported fields
}
HostCpuStatsCalculator calculates cpu usage percentages
func NewHostCpuStatsCalculator ¶
func NewHostCpuStatsCalculator() *HostCpuStatsCalculator
NewHostCpuStatsCalculator returns a HostCpuStatsCalculator
type HostStats ¶
type HostStats struct { Memory *MemoryStats CPU []*CPUStats DiskStats []*DiskStats AllocDirStats *DiskStats Uptime uint64 Timestamp int64 CPUTicksConsumed float64 }
HostStats represents resource usage stats of the host running a Nomad client
type HostStatsCollector ¶
type HostStatsCollector struct {
// contains filtered or unexported fields
}
HostStatsCollector collects host resource usage stats
func NewHostStatsCollector ¶
func NewHostStatsCollector(logger *log.Logger, allocDir string) *HostStatsCollector
NewHostStatsCollector returns a HostStatsCollector. The allocDir is passed in so that we can present the disk related statistics for the mountpoint where the allocation directory lives
func (*HostStatsCollector) Collect ¶
func (h *HostStatsCollector) Collect() error
Collect collects stats related to resource usage of a host
func (*HostStatsCollector) Stats ¶ added in v0.5.2
func (h *HostStatsCollector) Stats() *HostStats
Stats returns the host stats that has been collected
type MemoryStats ¶
MemoryStats represents stats related to virtual memory usage
type NodeStatsCollector ¶ added in v0.5.2
NodeStatsCollector is an interface which is used for the purposes of mocking the HostStatsCollector in the tests