Documentation ¶
Overview ¶
Package cpufreq provides the current CPU frequency, in MHz, as reported by /proc/cpuinfo.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTicker ¶
NewTicker returns a new Ticker containing a Data channel that delivers the data at intervals and an error channel that delivers any errors encountered. Stop the ticker to signal the ticker to stop running. Stopping the ticker does not close the Data channel; call Close to close both the ticker and the data channel.
Types ¶
type CPU ¶
type CPU struct { Processor int32 `json:"processor"` CPUMHz float32 `json:"cpu_mhz"` PhysicalID int32 `json:"physical_id"` CoreID int32 `json:"core_id"` APICID int32 `json:"apicid"` }
CPU holds the clock info for a single processor.
type Frequency ¶
type Frequency struct { Timestamp int64 `json:"timestamp"` Sockets int32 `json:"sockets"` CPU []CPU `json:"cpu"` }
Frequency holds information about the current frequency of a system's cpus, in MHz. The reported values are the current speeds as reported by /proc/cpuinfo.
type Profiler ¶
type Profiler struct { joe.Procer *joe.Buffer Frequency // this is used too hold the socket/cpu info so that everything doesn't have to be reprocessed. }
Profiler is used to process the frequency information.
func NewProfiler ¶
Returns an initialized Profiler; ready to use.
func (*Profiler) InitFrequency ¶
InitFrequency sets the profiler's frequency with the static information so that everything doesn't need to be reprocessed every time the frequency is requested. This assumes that cpuinfo returns processor information in the same order every time.
This shouldn't be used; it's exported for testing reasons.
Directories ¶
Path | Synopsis |
---|---|
Package cpufreq provides the current CPU frequency, in MHz, as reported by /proc/cpuinfo.
|
Package cpufreq provides the current CPU frequency, in MHz, as reported by /proc/cpuinfo. |
Package cpufreq provides the current CPU frequency, in MHz, as reported by /proc/cpuinfo.
|
Package cpufreq provides the current CPU frequency, in MHz, as reported by /proc/cpuinfo. |