Example #1
0
// Unexported functions
func parseCgroupMemLine(g *metrics.Gauge, f []string) {
	length := len(f)
	val := math.NaN()

	if length < 2 {
		goto fail
	}

	val = float64(misc.ParseUint(f[1]))
	g.Set(val)
	return

fail:
	g.Set(math.NaN())
	return
}
Example #2
0
// Unexported functions
func parseMemLine(g *metrics.Gauge, f []string) {
	length := len(f)
	val := math.NaN()

	if length < 2 {
		goto fail
	}

	val = float64(misc.ParseUint(f[1]))
	if length > 2 && f[2] == "kB" {
		val *= 1024
	}

	g.Set(val)
	return

fail:
	g.Set(math.NaN())
	return
}