Ejemplo n.º 1
0
func formatMemory(m report.Metric) (report.Metric, string) {
	s := m.LastSample()
	if s == nil {
		return m, ""
	}
	human, divisor := memoryScale(s.Value)
	return m.Div(divisor), fmt.Sprintf("%0.2f %s", s.Value/divisor, human)
}
Ejemplo n.º 2
0
func formatPercent(m report.Metric) (report.Metric, string) {
	if s := m.LastSample(); s != nil {
		return m, fmt.Sprintf("%0.2f%%", s.Value)
	}
	return m, ""
}