metrics: disable CPU stats (gosigar) on iOS
This commit is contained in:
@ -16,21 +16,9 @@
|
||||
|
||||
package metrics
|
||||
|
||||
import "github.com/elastic/gosigar"
|
||||
|
||||
// CPUStats is the system and process CPU stats.
|
||||
type CPUStats struct {
|
||||
GlobalTime int64 // Time spent by the CPU working on all processes
|
||||
GlobalWait int64 // Time spent by waiting on disk for all processes
|
||||
LocalTime int64 // Time spent by the CPU working on this process
|
||||
}
|
||||
|
||||
// ReadCPUStats retrieves the current CPU stats.
|
||||
func ReadCPUStats(stats *CPUStats) {
|
||||
global := gosigar.Cpu{}
|
||||
global.Get()
|
||||
|
||||
stats.GlobalTime = int64(global.User + global.Nice + global.Sys)
|
||||
stats.GlobalWait = int64(global.Wait)
|
||||
stats.LocalTime = getProcessCPUTime()
|
||||
}
|
||||
|
Reference in New Issue
Block a user