From 14c9d0370f52fdc2d69cba567b1562307dc066b5 Mon Sep 17 00:00:00 2001 From: Sergey Morozov <38383507+ken3122@users.noreply.github.com> Date: Sun, 9 Oct 2022 01:50:45 +0600 Subject: [PATCH] 4kB size added for postgres with 4kB block_size Signed-off-by: Sergey Morozov <38383507+ken3122@users.noreply.github.com> --- 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 bfe4c6c5..28a08a70 100644 --- a/cmd/postgres_exporter/pg_setting.go +++ b/cmd/postgres_exporter/pg_setting.go @@ -129,7 +129,7 @@ func (s *pgSetting) normaliseUnit() (val float64, unit string, err error) { return case "ms", "s", "min", "h", "d": unit = "seconds" - case "B", "kB", "MB", "GB", "TB", "8kB", "16kB", "32kB", "16MB", "32MB", "64MB": + case "B", "kB", "MB", "GB", "TB", "4kB", "8kB", "16kB", "32kB", "16MB", "32MB", "64MB": unit = "bytes" default: err = fmt.Errorf("Unknown unit for runtime variable: %q", s.unit) @@ -158,6 +158,8 @@ func (s *pgSetting) normaliseUnit() (val float64, unit string, err error) { val *= math.Pow(2, 30) case "TB": val *= math.Pow(2, 40) + case "4kB": + val *= math.Pow(2, 12) case "8kB": val *= math.Pow(2, 13) case "16kB":