From 2db8b47fe8f6c47cad7a3adbedc49459c4432e10 Mon Sep 17 00:00:00 2001 From: Hang Sun Date: Tue, 27 Feb 2018 10:12:55 -0800 Subject: [PATCH] Added a new unit 32kB --- cmd/postgres_exporter/pg_setting.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/postgres_exporter/pg_setting.go b/cmd/postgres_exporter/pg_setting.go index fa7a5838..e3b89b55 100644 --- a/cmd/postgres_exporter/pg_setting.go +++ b/cmd/postgres_exporter/pg_setting.go @@ -96,7 +96,7 @@ func (s *pgSetting) normaliseUnit() (val float64, unit string, err error) { return case "ms", "s", "min", "h", "d": unit = "seconds" - case "kB", "MB", "GB", "TB", "8kB", "16kB", "16MB": + case "kB", "MB", "GB", "TB", "8kB", "16kB", "32kB", "16MB": unit = "bytes" default: err = fmt.Errorf("Unknown unit for runtime variable: %q", s.unit) @@ -129,6 +129,8 @@ func (s *pgSetting) normaliseUnit() (val float64, unit string, err error) { val *= math.Pow(2, 13) case "16kB": val *= math.Pow(2, 14) + case "32kB": + val *= math.Pow(2, 15) case "16MB": val *= math.Pow(2, 24) }