Documentation ¶
Index ¶
Constants ¶
View Source
const ( /* CPU time is stored in system clock ticks. Most modern linux systems use 100 clock ticks per second, or 100 Hz. Use "getconf CLK_TCK" to verify this. Since our cycle time is 15 seconds, there's 1500 ticks to spend each cycle. If a process uses 750 ticks on the CPU, that means it used 50% of the CPU during that cycle. Multithreaded processes running on systems with multiple CPUs/cores can use more than 100% CPU. */ CLK_TCK = 100 // all metric ring buffers will store one hour of metric history SLOTS = 3600 / 15 )
Variables ¶
View Source
var ( DisplayPercent = func(val float64) string { return strconv.FormatFloat(val, 'f', 1, 64) + "%" } DisplayInMB = func(val float64) string { return strconv.FormatFloat(val/(1024*1024), 'f', 2, 64) + "m" } )
Functions ¶
This section is empty.
Types ¶
type DisplayFunc ¶
Convert the raw metric value into something displayable to the user.
type Store ¶
type Store interface { Get(family string, name string) float64 Display(family string, name string) string Collect(pid int) error Families() []string MetricNames(family string) []string Save(family, name string, value float64) DeclareCounter(family, name string, xform TransformFunc, display DisplayFunc) DeclareGauge(family, name string, display DisplayFunc) Metric(family, name string) Metric }
func NewHostStore ¶
func NewMockStore ¶
func NewMockStore() Store
func NewProcessStore ¶
type TransformFunc ¶
transform the raw collected data into something we can compare. Used by cpu(*) to transform raw ticks into a percentage.
Click to show internal directories.
Click to hide internal directories.