mirror of
https://github.com/prometheus-community/postgres_exporter
synced 2025-04-30 06:58:02 +00:00
parent
17592ee8e9
commit
e701b80fd5
@ -3,7 +3,7 @@ services:
|
|||||||
- docker
|
- docker
|
||||||
language: go
|
language: go
|
||||||
go:
|
go:
|
||||||
- '1.8'
|
- '1.9'
|
||||||
# Make sure we have p2 and the postgres client.
|
# Make sure we have p2 and the postgres client.
|
||||||
before_install:
|
before_install:
|
||||||
- go get -v github.com/mattn/goveralls
|
- go get -v github.com/mattn/goveralls
|
||||||
|
@ -94,7 +94,7 @@ func (s *pgSetting) normaliseUnit() (val float64, unit string, err error) {
|
|||||||
return
|
return
|
||||||
case "ms", "s", "min", "h", "d":
|
case "ms", "s", "min", "h", "d":
|
||||||
unit = "seconds"
|
unit = "seconds"
|
||||||
case "kB", "MB", "GB", "TB", "8kB", "16MB":
|
case "kB", "MB", "GB", "TB", "8kB", "16kB", "16MB":
|
||||||
unit = "bytes"
|
unit = "bytes"
|
||||||
default:
|
default:
|
||||||
err = fmt.Errorf("Unknown unit for runtime variable: %q", s.unit)
|
err = fmt.Errorf("Unknown unit for runtime variable: %q", s.unit)
|
||||||
@ -125,6 +125,8 @@ func (s *pgSetting) normaliseUnit() (val float64, unit string, err error) {
|
|||||||
val *= math.Pow(2, 40)
|
val *= math.Pow(2, 40)
|
||||||
case "8kB":
|
case "8kB":
|
||||||
val *= math.Pow(2, 13)
|
val *= math.Pow(2, 13)
|
||||||
|
case "16kB":
|
||||||
|
val *= math.Pow(2, 14)
|
||||||
case "16MB":
|
case "16MB":
|
||||||
val *= math.Pow(2, 24)
|
val *= math.Pow(2, 24)
|
||||||
}
|
}
|
||||||
|
@ -60,6 +60,22 @@ var fixtures = []fixture{
|
|||||||
d: "Desc{fqName: \"pg_settings_eight_kb_fixture_metric_bytes\", help: \"Foo foo foo [Units converted to bytes.]\", constLabels: {}, variableLabels: []}",
|
d: "Desc{fqName: \"pg_settings_eight_kb_fixture_metric_bytes\", help: \"Foo foo foo [Units converted to bytes.]\", constLabels: {}, variableLabels: []}",
|
||||||
v: 139264,
|
v: 139264,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
p: pgSetting{
|
||||||
|
name: "16_kb_real_fixture_metric",
|
||||||
|
setting: "3.0",
|
||||||
|
unit: "16kB",
|
||||||
|
shortDesc: "Foo foo foo",
|
||||||
|
vartype: "real",
|
||||||
|
},
|
||||||
|
n: normalised{
|
||||||
|
val: 49152,
|
||||||
|
unit: "bytes",
|
||||||
|
err: "",
|
||||||
|
},
|
||||||
|
d: "Desc{fqName: \"pg_settings_16_kb_real_fixture_metric_bytes\", help: \"Foo foo foo [Units converted to bytes.]\", constLabels: {}, variableLabels: []}",
|
||||||
|
v: 49152,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
p: pgSetting{
|
p: pgSetting{
|
||||||
name: "16_mb_real_fixture_metric",
|
name: "16_mb_real_fixture_metric",
|
||||||
|
Loading…
Reference in New Issue
Block a user