Skip to content

Commit a719787

Browse files
authored
Fix cache hit ratio panel
This rounds to .001, otherwise cache hit axis was showing multiple points with 100% since values were rounded at axis, but not raw values, which changes from 0.9900001 were shown 0.9900002 on graphs, causing visual noise)
1 parent 994e5cc commit a719787

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

postgres_mixin/dashboards/postgres-overview.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,9 +1136,8 @@
11361136
"steppedLine": false,
11371137
"targets": [
11381138
{
1139-
"expr": "sum by (datname) (rate(pg_stat_database_blks_hit{datname=~\"$db\",job=~\"$job\",instance=~\"$instance\"}[$__rate_interval])) / (sum by (datname)(rate(pg_stat_database_blks_hit{datname=~\"$db\",job=~\"$job\",instance=~\"$instance\"}[$__rate_interval])) + sum by (datname)(rate(pg_stat_database_blks_read{datname=~\"$db\",job=~\"$job\",instance=~\"$instance\"}[$__rate_interval])))",
1139+
"expr": "round(sum by (datname) (rate(pg_stat_database_blks_hit{datname=~\"$db\",job=~\"$job\",instance=~\"$instance\"}[$__rate_interval])) / (sum by (datname)(rate(pg_stat_database_blks_hit{datname=~\"$db\",job=~\"$job\",instance=~\"$instance\"}[$__rate_interval])) + sum by (datname)(rate(pg_stat_database_blks_read{datname=~\"$db\",job=~\"$job\",instance=~\"$instance\"}[$__rate_interval])))*100,0.001)",
11401140
"format": "time_series",
1141-
"intervalFactor": 2,
11421141
"legendFormat": "{{datname}} - cache hit rate",
11431142
"refId": "A",
11441143
"step": 240
@@ -1165,11 +1164,11 @@
11651164
},
11661165
"yaxes": [
11671166
{
1168-
"format": "percentunit",
1167+
"format": "percent",
11691168
"label": null,
11701169
"logBase": 1,
1171-
"max": null,
1172-
"min": null,
1170+
"max": 100,
1171+
"min": 0,
11731172
"show": true
11741173
},
11751174
{

0 commit comments

Comments
 (0)