Skip to content

Commit d11d8a8

Browse files
committed
Add Auto option to $online_interval variable.
The `Auto` option will contain a value identical to the current time range, so we can partially avoid the imprecision of `$__timeGroup()`
1 parent a7eca6c commit d11d8a8

File tree

1 file changed

+41
-16
lines changed

1 file changed

+41
-16
lines changed

grafana/postgres/v12/0-health-check.json

Lines changed: 41 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4987,7 +4987,7 @@
49874987
"description": "Percentage of total query execution time spent in JIT. (requires stat_statements_jit metric)",
49884988
"fieldConfig": {
49894989
"defaults": {
4990-
"decimals": 1,
4990+
"decimals": 5,
49914991
"mappings": [
49924992
{
49934993
"options": {
@@ -5077,7 +5077,7 @@
50775077
"orderByTime": "ASC",
50785078
"policy": "default",
50795079
"rawQuery": true,
5080-
"rawSql": "select \n $__timeGroup(time, $__interval),\n (sum(total_jit - total_jit_lag) / sum(total_time - total_time_lag)) * 100 as pct\nfrom\n(\n select\n time,\n (data->>'total_jit_time')::float8 as total_jit, lag((data->>'total_jit_time')::float8) over w as total_jit_lag,\n (data->>'total_time')::float8 as total_time, lag((data->>'total_time')::float8) over w as total_time_lag\n from\n stat_statements_jit\n where \n dbname = '$dbname' and $__timeFilter(time)\n window w as (order by time)\n)\nwhere total_time > total_time_lag\ngroup by 1\norder by 1 desc\nlimit 1",
5080+
"rawSql": "select \n $__timeGroup(time, $online_interval),\n (sum(total_jit - total_jit_lag) / sum(total_time - total_time_lag)) * 100 as pct\nfrom\n(\n select\n time,\n (data->>'total_jit_time')::float8 as total_jit, lag((data->>'total_jit_time')::float8) over w as total_jit_lag,\n (data->>'total_time')::float8 as total_time, lag((data->>'total_time')::float8) over w as total_time_lag\n from\n stat_statements_jit\n where \n dbname = '$dbname' and $__timeFilter(time)\n window w as (order by time)\n)\nwhere total_time > total_time_lag\ngroup by 1\norder by 1 desc\nlimit 1",
50815081
"refId": "A",
50825082
"resultFormat": "time_series",
50835083
"select": [
@@ -5205,14 +5205,14 @@
52055205
"type": "query"
52065206
},
52075207
{
5208-
"auto": false,
5209-
"auto_count": 30,
5208+
"auto": true,
5209+
"auto_count": 1,
52105210
"auto_min": "10s",
52115211
"current": {
5212-
"text": "10m",
5213-
"value": "10m"
5212+
"text": "$__auto",
5213+
"value": "$__auto"
52145214
},
5215-
"label": "Max. age for 'online' metrics",
5215+
"hide": 3,
52165216
"name": "online_interval",
52175217
"options": [
52185218
{
@@ -5222,23 +5222,48 @@
52225222
},
52235223
{
52245224
"selected": false,
5225-
"text": "3m",
5226-
"value": "3m"
5225+
"text": "10m",
5226+
"value": "10m"
52275227
},
52285228
{
52295229
"selected": false,
5230-
"text": "5m",
5231-
"value": "5m"
5230+
"text": "30m",
5231+
"value": "30m"
52325232
},
52335233
{
5234-
"selected": true,
5235-
"text": "10m",
5236-
"value": "10m"
5234+
"selected": false,
5235+
"text": "1h",
5236+
"value": "1h"
5237+
},
5238+
{
5239+
"selected": false,
5240+
"text": "6h",
5241+
"value": "6h"
5242+
},
5243+
{
5244+
"selected": false,
5245+
"text": "12h",
5246+
"value": "12h"
5247+
},
5248+
{
5249+
"selected": false,
5250+
"text": "1d",
5251+
"value": "1d"
5252+
},
5253+
{
5254+
"selected": false,
5255+
"text": "7d",
5256+
"value": "7d"
5257+
},
5258+
{
5259+
"selected": false,
5260+
"text": "14d",
5261+
"value": "14d"
52375262
},
52385263
{
52395264
"selected": false,
5240-
"text": "15m",
5241-
"value": "15m"
5265+
"text": "30d",
5266+
"value": "30d"
52425267
}
52435268
],
52445269
"query": "1m,3m,5m,10m,15m",

0 commit comments

Comments
 (0)