From c3c693be4c220ff6fe698e9b3e72ad7ad9b1c413 Mon Sep 17 00:00:00 2001 From: Se-L Date: Fri, 13 Apr 2018 10:16:29 +0800 Subject: [PATCH 1/2] Update pg_setting.go --- cmd/postgres_exporter/pg_setting.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/postgres_exporter/pg_setting.go b/cmd/postgres_exporter/pg_setting.go index e3b89b55a..8ac174789 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", "32kB", "16MB": + case "kB", "MB", "GB", "TB", "8kB", "16kB", "32kB", "16MB", "32MB", "64MB": unit = "bytes" default: err = fmt.Errorf("Unknown unit for runtime variable: %q", s.unit) @@ -134,6 +134,9 @@ func (s *pgSetting) normaliseUnit() (val float64, unit string, err error) { case "16MB": val *= math.Pow(2, 24) } - + case "32MB": + val *= math.Pow(2, 25) + case "64MB": + val *= math.Pow(2, 26) return } From 0661b9fdb93f80c54ae12193aae8958426781e65 Mon Sep 17 00:00:00 2001 From: Se-L Date: Fri, 13 Apr 2018 10:27:48 +0800 Subject: [PATCH 2/2] Update pg_setting.go --- cmd/postgres_exporter/pg_setting.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/postgres_exporter/pg_setting.go b/cmd/postgres_exporter/pg_setting.go index 8ac174789..38c1ae2a1 100644 --- a/cmd/postgres_exporter/pg_setting.go +++ b/cmd/postgres_exporter/pg_setting.go @@ -133,10 +133,11 @@ func (s *pgSetting) normaliseUnit() (val float64, unit string, err error) { val *= math.Pow(2, 15) case "16MB": val *= math.Pow(2, 24) - } case "32MB": val *= math.Pow(2, 25) case "64MB": - val *= math.Pow(2, 26) + val *= math.Pow(2, 26) + } + return }