示例#1
0
func (load DataPoint) ToMetrics() *[]statsd.Metric {
	list := []statsd.Metric{
		statsd.Gauge("system.cpu.loadavg.one", load.Last1Min),
		statsd.Gauge("system.cpu.loadavg.five", load.Last5Min),
		statsd.Gauge("system.cpu.loadavg.fifteen", load.Last15Min),
	}
	return &list
}
示例#2
0
func (point DataPoint) ToMetrics() *[]statsd.Metric {
	metrics := []statsd.Metric{
		statsd.Gauge("system.memory.total", point.total),
		statsd.Gauge("system.memory.used", point.used),
		statsd.Gauge("system.memory.free", point.free),
		statsd.Gauge("system.memory.shared", point.shared),
		statsd.Gauge("system.memory.buffers", point.buffers),
		statsd.Gauge("system.memory.cached", point.cached),
		statsd.Gauge("system.memory.available", point.Available()),
		statsd.Gauge("system.memory.usagePct", point.UsagePct()),
	}
	return &metrics
}
示例#3
0
func (usage Usage) ToMetrics() *[]statsd.Metric {
	list := []statsd.Metric{
		statsd.Gauge("disk_usage.blocks.total."+usage.device, usage.total_blocks),
		statsd.Gauge("disk_usage.blocks.used."+usage.device, usage.used_blocks),
		statsd.Gauge("disk_usage.blocks.available."+usage.device, usage.available_blocks),
		statsd.Gauge("disk_usage.blocks.usagePct."+usage.device, usage.BlockPct()),
		statsd.Gauge("disk_usage.inodes.total."+usage.device, usage.total_inodes),
		statsd.Gauge("disk_usage.inodes.used."+usage.device, usage.used_inodes),
		statsd.Gauge("disk_usage.inodes.available."+usage.device, usage.available_inodes),
		statsd.Gauge("disk_usage.inodes.usagePct."+usage.device, usage.InodePct()),
	}
	return &list
}