MCPcopy Create free account
hub / github.com/bytesizedhosting/bcd / Cpu

Method Cpu

plugins/stats/stats.go:97–113  ·  view source on GitHub ↗
(args int, res *CpuResponse)

Source from the content-addressed store, hash-verified

95}
96
97func (s *Stats) Cpu(args int, res *CpuResponse) error {
98 log.WithFields(log.Fields{
99 "plugin": s.GetName(),
100 "method": "Cpu",
101 }).Debug("Gathering CPU stats")
102
103 t, err := cpu.Times(false)
104 i, err := cpu.Info()
105 if err != nil {
106 return err
107 }
108
109 res.Times = t
110 res.Info = i
111
112 return nil
113}
114
115func (s *Stats) Memory(args *MemoryResponse, res *MemoryResponse) error {
116 log.WithFields(log.Fields{

Callers

nothing calls this directly

Calls 1

GetNameMethod · 0.65

Tested by

no test coverage detected