Skip to content

Commit 05d791b

Browse files
Added pg_index_pilot rebuild threshold to single index analysis, modified names on single table analysis
1 parent 3e2a793 commit 05d791b

File tree

2 files changed

+124
-23
lines changed

2 files changed

+124
-23
lines changed

config/grafana/dashboards/Dashboard_11_Single_index_analysis.json

Lines changed: 110 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"editable": true,
1919
"fiscalYearStartMonth": 0,
2020
"graphTooltip": 0,
21-
"id": 10,
21+
"id": 14,
2222
"links": [],
2323
"panels": [
2424
{
@@ -37,6 +37,7 @@
3737
"axisColorMode": "text",
3838
"axisLabel": "",
3939
"axisPlacement": "auto",
40+
"axisSoftMin": 0,
4041
"barAlignment": 0,
4142
"barWidthFactor": 0.6,
4243
"drawStyle": "line",
@@ -82,7 +83,7 @@
8283
{
8384
"matcher": {
8485
"id": "byName",
85-
"options": "Baseline Boguk ratio"
86+
"options": "Boguk ratio (index size / live tuples), baseline"
8687
},
8788
"properties": [
8889
{
@@ -107,7 +108,7 @@
107108
{
108109
"matcher": {
109110
"id": "byName",
110-
"options": "Boguk ratio"
111+
"options": "Boguk ratio (index size / live tuples), current"
111112
},
112113
"properties": [
113114
{
@@ -118,6 +119,43 @@
118119
}
119120
}
120121
]
122+
},
123+
{
124+
"matcher": {
125+
"id": "byName",
126+
"options": "index_rebuild_scale_factor"
127+
},
128+
"properties": [
129+
{
130+
"id": "custom.lineWidth",
131+
"value": 0
132+
}
133+
]
134+
},
135+
{
136+
"matcher": {
137+
"id": "byName",
138+
"options": "pg_index_pilot rebuild threshold "
139+
},
140+
"properties": [
141+
{
142+
"id": "custom.lineStyle",
143+
"value": {
144+
"dash": [
145+
10,
146+
10
147+
],
148+
"fill": "dash"
149+
}
150+
},
151+
{
152+
"id": "color",
153+
"value": {
154+
"fixedColor": "dark-orange",
155+
"mode": "fixed"
156+
}
157+
}
158+
]
121159
}
122160
]
123161
},
@@ -130,7 +168,11 @@
130168
"id": 1,
131169
"options": {
132170
"legend": {
133-
"calcs": [],
171+
"calcs": [
172+
"min",
173+
"max",
174+
"mean"
175+
],
134176
"displayMode": "table",
135177
"placement": "bottom",
136178
"showLegend": true
@@ -154,7 +196,7 @@
154196
"fullMetaSearch": false,
155197
"includeNullMetadata": true,
156198
"interval": "",
157-
"legendFormat": "Current Boguk ratio",
199+
"legendFormat": "Boguk ratio (index size / live tuples), current",
158200
"range": true,
159201
"refId": "A",
160202
"useBackend": false
@@ -168,12 +210,52 @@
168210
"expr": "pgwatch_pg_index_pilot_best_ratio{indexrelname=\"$index_name\", schemaname=\"$schema_name\"}",
169211
"hide": false,
170212
"instant": false,
171-
"legendFormat": "Baseline Boguk ratio",
213+
"legendFormat": "Boguk ratio (index size / live tuples), baseline",
172214
"range": true,
173215
"refId": "B"
216+
},
217+
{
218+
"datasource": {
219+
"type": "prometheus",
220+
"uid": "P7A0D6631BB10B34F"
221+
},
222+
"editorMode": "code",
223+
"expr": "max by () (\n last_over_time(pgwatch_pg_index_pilot_config_config_value_normalized{config_key=\"index_rebuild_scale_factor\", schemaname=~\"$schema_name\", indexrelname=~\"$index_name\", datname=~\"$datname\"}[1w]) * 8 or\n last_over_time(pgwatch_pg_index_pilot_config_config_value_normalized{config_key=\"index_rebuild_scale_factor\", schemaname=~\"$schema_name\", indexrelname=~\"$index_name\", datname=\"*\"}[1w]) * 7 or\n last_over_time(pgwatch_pg_index_pilot_config_config_value_normalized{config_key=\"index_rebuild_scale_factor\", schemaname=~\"$schema_name\", indexrelname=\"*\", datname=~\"$datname\"}[1w]) * 6 or\n last_over_time(pgwatch_pg_index_pilot_config_config_value_normalized{config_key=\"index_rebuild_scale_factor\", schemaname=\"*\", indexrelname=~\"$index_name\", datname=~\"$datname\"}[1w]) * 5 or\n last_over_time(pgwatch_pg_index_pilot_config_config_value_normalized{config_key=\"index_rebuild_scale_factor\", schemaname=\"*\", indexrelname=\"*\", datname=~\"$datname\"}[1w]) * 4 or\n last_over_time(pgwatch_pg_index_pilot_config_config_value_normalized{config_key=\"index_rebuild_scale_factor\", schemaname=~\"$schema_name\", indexrelname=\"*\", datname=\"*\"}[1w]) * 3 or\n last_over_time(pgwatch_pg_index_pilot_config_config_value_normalized{config_key=\"index_rebuild_scale_factor\", schemaname=\"*\", indexrelname=~\"$index_name\", datname=\"*\"}[1w]) * 2 or\n last_over_time(pgwatch_pg_index_pilot_config_config_value_normalized{config_key=\"index_rebuild_scale_factor\", schemaname=\"*\", indexrelname=\"*\", datname=\"*\"}[1w]) * 1\n) / \nmax by () (\n 8 * (last_over_time(pgwatch_pg_index_pilot_config_config_value_normalized{config_key=\"index_rebuild_scale_factor\", schemaname=~\"$schema_name\", indexrelname=~\"$index_name\", datname=~\"$datname\"}[1w]) * 0 + 1) or\n 7 * (last_over_time(pgwatch_pg_index_pilot_config_config_value_normalized{config_key=\"index_rebuild_scale_factor\", schemaname=~\"$schema_name\", indexrelname=~\"$index_name\", datname=\"*\"}[1w]) * 0 + 1) or\n 6 * (last_over_time(pgwatch_pg_index_pilot_config_config_value_normalized{config_key=\"index_rebuild_scale_factor\", schemaname=~\"$schema_name\", indexrelname=\"*\", datname=~\"$datname\"}[1w]) * 0 + 1) or\n 5 * (last_over_time(pgwatch_pg_index_pilot_config_config_value_normalized{config_key=\"index_rebuild_scale_factor\", schemaname=\"*\", indexrelname=~\"$index_name\", datname=~\"$datname\"}[1w]) * 0 + 1) or\n 4 * (last_over_time(pgwatch_pg_index_pilot_config_config_value_normalized{config_key=\"index_rebuild_scale_factor\", schemaname=\"*\", indexrelname=\"*\", datname=~\"$datname\"}[1w]) * 0 + 1) or\n 3 * (last_over_time(pgwatch_pg_index_pilot_config_config_value_normalized{config_key=\"index_rebuild_scale_factor\", schemaname=~\"$schema_name\", indexrelname=\"*\", datname=\"*\"}[1w]) * 0 + 1) or\n 2 * (last_over_time(pgwatch_pg_index_pilot_config_config_value_normalized{config_key=\"index_rebuild_scale_factor\", schemaname=\"*\", indexrelname=~\"$index_name\", datname=\"*\"}[1w]) * 0 + 1) or\n 1 * (last_over_time(pgwatch_pg_index_pilot_config_config_value_normalized{config_key=\"index_rebuild_scale_factor\", schemaname=\"*\", indexrelname=\"*\", datname=\"*\"}[1w]) * 0 + 1)\n)",
224+
"hide": false,
225+
"instant": false,
226+
"legendFormat": "index_rebuild_scale_factor",
227+
"range": true,
228+
"refId": "C"
174229
}
175230
],
176231
"title": "",
232+
"transformations": [
233+
{
234+
"id": "calculateField",
235+
"options": {
236+
"alias": "pg_index_pilot rebuild threshold ",
237+
"binary": {
238+
"left": {
239+
"matcher": {
240+
"id": "byName",
241+
"options": "Boguk ratio (index size / live tuples), baseline"
242+
}
243+
},
244+
"operator": "*",
245+
"right": {
246+
"matcher": {
247+
"id": "byName",
248+
"options": "index_rebuild_scale_factor"
249+
}
250+
}
251+
},
252+
"mode": "binary",
253+
"reduce": {
254+
"reducer": "sum"
255+
}
256+
}
257+
}
258+
],
177259
"type": "timeseries"
178260
}
179261
],
@@ -182,6 +264,24 @@
182264
"tags": [],
183265
"templating": {
184266
"list": [
267+
{
268+
"current": {
269+
"text": "workloaddb",
270+
"value": "workloaddb"
271+
},
272+
"definition": "label_values(pgwatch_pg_index_pilot_best_ratio,datname)",
273+
"label": "DB name",
274+
"name": "datname",
275+
"options": [],
276+
"query": {
277+
"qryType": 1,
278+
"query": "label_values(pgwatch_pg_index_pilot_best_ratio,datname)",
279+
"refId": "PrometheusVariableQueryEditor-VariableQuery"
280+
},
281+
"refresh": 1,
282+
"regex": "",
283+
"type": "query"
284+
},
185285
{
186286
"current": {
187287
"text": "test_pilot",
@@ -201,8 +301,8 @@
201301
},
202302
{
203303
"current": {
204-
"text": "",
205-
"value": ""
304+
"text": "items_email_idx",
305+
"value": "items_email_idx"
206306
},
207307
"definition": "label_values(pgwatch_pg_index_pilot_estimated_tuples{schemaname=\"$schema_name\"},indexrelname)",
208308
"name": "index_name",
@@ -219,12 +319,12 @@
219319
]
220320
},
221321
"time": {
222-
"from": "now-1h",
322+
"from": "now-12h",
223323
"to": "now"
224324
},
225325
"timepicker": {},
226326
"timezone": "browser",
227327
"title": "11. Single index analysis",
228328
"uid": "aa0128c5-c5a0-4418-a99e-c941af10426e",
229-
"version": 6
329+
"version": 4
230330
}

config/grafana/dashboards/Dashboard_9_Single_table_analysis.json

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"editable": true,
1919
"fiscalYearStartMonth": 0,
2020
"graphTooltip": 1,
21-
"id": 12,
21+
"id": 16,
2222
"links": [],
2323
"panels": [
2424
{
@@ -37,8 +37,8 @@
3737
"axisColorMode": "text",
3838
"axisLabel": "",
3939
"axisPlacement": "auto",
40-
"barAlignment": 0,
4140
"axisSoftMin": 0,
41+
"barAlignment": 0,
4242
"barWidthFactor": 0.6,
4343
"drawStyle": "line",
4444
"fillOpacity": 0,
@@ -116,7 +116,7 @@
116116
"useBackend": false
117117
}
118118
],
119-
"title": "Table size",
119+
"title": "Total table size",
120120
"type": "timeseries"
121121
},
122122
{
@@ -135,8 +135,8 @@
135135
"axisColorMode": "text",
136136
"axisLabel": "",
137137
"axisPlacement": "auto",
138-
"barAlignment": 0,
139138
"axisSoftMin": 0,
139+
"barAlignment": 0,
140140
"barWidthFactor": 0.6,
141141
"drawStyle": "line",
142142
"fillOpacity": 0,
@@ -215,7 +215,7 @@
215215
"useBackend": false
216216
}
217217
],
218-
"title": "Table size change rate",
218+
"title": "Table size change rate (absolute)",
219219
"type": "timeseries"
220220
},
221221
{
@@ -247,8 +247,8 @@
247247
"axisColorMode": "text",
248248
"axisLabel": "",
249249
"axisPlacement": "auto",
250-
"barAlignment": 0,
251250
"axisSoftMin": 0,
251+
"barAlignment": 0,
252252
"barWidthFactor": 0.6,
253253
"drawStyle": "line",
254254
"fillOpacity": 0,
@@ -314,7 +314,7 @@
314314
},
315315
"tooltip": {
316316
"hideZeros": false,
317-
"mode": "single",
317+
"mode": "multi",
318318
"sort": "none"
319319
}
320320
},
@@ -351,8 +351,9 @@
351351
"axisColorMode": "text",
352352
"axisLabel": "",
353353
"axisPlacement": "auto",
354-
"barAlignment": 0,
354+
"axisSoftMax": 100,
355355
"axisSoftMin": 0,
356+
"barAlignment": 0,
356357
"barWidthFactor": 0.6,
357358
"drawStyle": "line",
358359
"fillOpacity": 0,
@@ -468,8 +469,8 @@
468469
"axisColorMode": "text",
469470
"axisLabel": "",
470471
"axisPlacement": "auto",
471-
"barAlignment": 0,
472472
"axisSoftMin": 0,
473+
"barAlignment": 0,
473474
"barWidthFactor": 0.6,
474475
"drawStyle": "line",
475476
"fillOpacity": 100,
@@ -596,7 +597,7 @@
596597
},
597598
"tooltip": {
598599
"hideZeros": false,
599-
"mode": "single",
600+
"mode": "multi",
600601
"sort": "none"
601602
}
602603
},
@@ -729,8 +730,8 @@
729730
"axisColorMode": "text",
730731
"axisLabel": "",
731732
"axisPlacement": "auto",
732-
"barAlignment": 0,
733733
"axisSoftMin": 0,
734+
"barAlignment": 0,
734735
"barWidthFactor": 0.6,
735736
"drawStyle": "line",
736737
"fillOpacity": 100,
@@ -857,7 +858,7 @@
857858
},
858859
"tooltip": {
859860
"hideZeros": false,
860-
"mode": "single",
861+
"mode": "multi",
861862
"sort": "none"
862863
}
863864
},
@@ -1224,5 +1225,5 @@
12241225
"timezone": "utc",
12251226
"title": "09. Single table analysis",
12261227
"uid": "9-single-table-analysis",
1227-
"version": 5
1228+
"version": 8
12281229
}

0 commit comments

Comments
 (0)