Documentation
¶
Index ¶
Constants ¶
View Source
const ( // FrequencySourceSysfs indicates the value came from the cpufreq sysfs interface. FrequencySourceSysfs = "sysfs" // FrequencySourceProcCPU indicates the value came from /proc/cpuinfo via gopsutil. FrequencySourceProcCPU = "procfs" // FrequencySourcePerf indicates the value was derived from perf counters. FrequencySourcePerf = "perf" // FrequencySourceHostfreq indicates the value was provided by the macOS host helper. FrequencySourceHostfreq = "hostfreq" )
Variables ¶
ErrFrequencyUnavailable is returned when no frequency data could be gathered.
Functions ¶
func NewCollector ¶
NewCollector returns a collection function that samples using the provided window.
func StartHostfreqSampler ¶
func StopHostfreqSampler ¶
func StopHostfreqSampler()
Types ¶
type ClusterFrequency ¶
type ClusterFrequency struct {
Name string // cluster label (e.g. ECPU, PCPU)
FrequencyHz float64 // instantaneous frequency in Hz
Source string // data source used
}
ClusterFrequency represents the current frequency reading for a CPU cluster.
type CoreFrequency ¶
type CoreFrequency struct {
CoreID int // zero-based logical core ID
Label string // platform-specific identifier (e.g. ECPU0)
Cluster string // logical cluster this core belongs to (e.g. ECPU)
FrequencyHz float64 // instantaneous frequency in Hz
Source string // data source used (sysfs, procfs, perf, hostfreq)
}
CoreFrequency represents the current frequency reading for a logical CPU.
type Snapshot ¶
type Snapshot struct {
Cores []CoreFrequency
Clusters []ClusterFrequency
}
Snapshot contains a collection of per-core frequency readings.
Click to show internal directories.
Click to hide internal directories.