Skip to content

Commit

Permalink
Rendering trackdb values
Browse files Browse the repository at this point in the history
  • Loading branch information
GilHoggarth committed Aug 28, 2020
1 parent 10ab00e commit 5038e72
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def replace_output_single(outHandle, **kwargs):
expr = 'count(probe_http_status_code{job=\\"' + kwargs['job'] + '\\"} != 200) OR vector(0)'
templateCode = templateCode.replace('<expr>', expr)
elif kwargs['title'] == 'trackdb refresh':
expr = 'sum((time() - trackdb_refresh_timestamp) / (60*60) > 24) OR vector(0)'
expr = '(time() - trackdb_refresh_timestamp) / (60*60)'
templateCode = templateCode.replace('<expr>', expr)
elif kwargs['title'] == 'trackdb numFound':
expr = 'sum(trackdb_numFound - (trackdb_numFound offset 1d))'
Expand Down Expand Up @@ -210,10 +210,10 @@ def main():
replace_output_single(outHandle, pnl = panelStat, job = 'infrastructure', title = 'Mem', h=2, w=2, x=14, y=10)

replace_output_title(outHandle, pnl=panelTitle, job='wa_services', title='WA Services', h=1, w=24, x=0, y=12)
replace_output_single(outHandle, pnl=panelStat, job='trackdb', title='trackdb refresh', h=2, w=3, x=0, y=13, textmode='value', threshold2='22', threshold3='24')
replace_output_single(outHandle, pnl=panelStat, job='trackdb', title='trackdb refresh', h=2, w=3, x=0, y=13, textmode='value', threshold2='22', threshold3='26')
# output last panel with final ',' removed to make output json valid
# replace_output_single(outHandle, pnl=panelSingle, job='trackdb', title='trackdb numFound', h=2, w=3, x=3, y=13, thresholds='10,100', colour1='#D44A3A', colour3='#299C46', lastPanel=True)
replace_output_single(outHandle, pnl=panelStat, job='trackdb', title='trackdb numFound', h=2, w=3, x=3, y=13, textnode='value', threshold2='10', threshold3='100', colour1='#D44A3A', colour3='#299C46', lastPanel=True)
replace_output_single(outHandle, pnl=panelStat, job='trackdb', title='trackdb numFound', h=2, w=3, x=3, y=13, textmode='value', threshold2='10', threshold3='100', colour1='#D44A3A', colour3='#299C46', lastPanel=True)

# amend dashboard values
output(outHandle, pnl = panelFooter)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"fields": ""
},
"orientation": "horizontal",
"textMode": "<textMode>",
"textMode": "<textmode>",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
Expand Down
76 changes: 38 additions & 38 deletions monitor/grafana/provisioning/dashboards/wa_status.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"fields": ""
},
"orientation": "horizontal",
"textMode": "<textMode>",
"textMode": "none",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
Expand Down Expand Up @@ -161,7 +161,7 @@
"fields": ""
},
"orientation": "horizontal",
"textMode": "<textMode>",
"textMode": "none",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
Expand Down Expand Up @@ -237,7 +237,7 @@
"fields": ""
},
"orientation": "horizontal",
"textMode": "<textMode>",
"textMode": "none",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
Expand Down Expand Up @@ -313,7 +313,7 @@
"fields": ""
},
"orientation": "horizontal",
"textMode": "<textMode>",
"textMode": "none",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
Expand Down Expand Up @@ -389,7 +389,7 @@
"fields": ""
},
"orientation": "horizontal",
"textMode": "<textMode>",
"textMode": "none",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
Expand Down Expand Up @@ -479,7 +479,7 @@
"fields": ""
},
"orientation": "horizontal",
"textMode": "<textMode>",
"textMode": "none",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
Expand Down Expand Up @@ -555,7 +555,7 @@
"fields": ""
},
"orientation": "horizontal",
"textMode": "<textMode>",
"textMode": "none",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
Expand Down Expand Up @@ -631,7 +631,7 @@
"fields": ""
},
"orientation": "horizontal",
"textMode": "<textMode>",
"textMode": "none",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
Expand Down Expand Up @@ -780,7 +780,7 @@
"fields": ""
},
"orientation": "horizontal",
"textMode": "<textMode>",
"textMode": "none",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
Expand Down Expand Up @@ -856,7 +856,7 @@
"fields": ""
},
"orientation": "horizontal",
"textMode": "<textMode>",
"textMode": "none",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
Expand Down Expand Up @@ -932,7 +932,7 @@
"fields": ""
},
"orientation": "horizontal",
"textMode": "<textMode>",
"textMode": "none",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
Expand Down Expand Up @@ -1022,7 +1022,7 @@
"fields": ""
},
"orientation": "horizontal",
"textMode": "<textMode>",
"textMode": "none",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
Expand Down Expand Up @@ -1098,7 +1098,7 @@
"fields": ""
},
"orientation": "horizontal",
"textMode": "<textMode>",
"textMode": "none",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
Expand Down Expand Up @@ -1174,7 +1174,7 @@
"fields": ""
},
"orientation": "horizontal",
"textMode": "<textMode>",
"textMode": "none",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
Expand Down Expand Up @@ -1250,7 +1250,7 @@
"fields": ""
},
"orientation": "horizontal",
"textMode": "<textMode>",
"textMode": "none",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
Expand Down Expand Up @@ -1326,7 +1326,7 @@
"fields": ""
},
"orientation": "horizontal",
"textMode": "<textMode>",
"textMode": "none",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
Expand Down Expand Up @@ -1402,7 +1402,7 @@
"fields": ""
},
"orientation": "horizontal",
"textMode": "<textMode>",
"textMode": "none",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
Expand Down Expand Up @@ -1492,7 +1492,7 @@
"fields": ""
},
"orientation": "horizontal",
"textMode": "<textMode>",
"textMode": "none",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
Expand Down Expand Up @@ -1568,7 +1568,7 @@
"fields": ""
},
"orientation": "horizontal",
"textMode": "<textMode>",
"textMode": "none",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
Expand Down Expand Up @@ -1644,7 +1644,7 @@
"fields": ""
},
"orientation": "horizontal",
"textMode": "<textMode>",
"textMode": "none",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
Expand Down Expand Up @@ -1720,7 +1720,7 @@
"fields": ""
},
"orientation": "horizontal",
"textMode": "<textMode>",
"textMode": "none",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
Expand Down Expand Up @@ -1810,7 +1810,7 @@
"fields": ""
},
"orientation": "horizontal",
"textMode": "<textMode>",
"textMode": "none",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
Expand Down Expand Up @@ -1886,7 +1886,7 @@
"fields": ""
},
"orientation": "horizontal",
"textMode": "<textMode>",
"textMode": "none",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
Expand Down Expand Up @@ -1962,7 +1962,7 @@
"fields": ""
},
"orientation": "horizontal",
"textMode": "<textMode>",
"textMode": "none",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
Expand Down Expand Up @@ -2038,7 +2038,7 @@
"fields": ""
},
"orientation": "horizontal",
"textMode": "<textMode>",
"textMode": "none",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
Expand Down Expand Up @@ -2128,7 +2128,7 @@
"fields": ""
},
"orientation": "horizontal",
"textMode": "<textMode>",
"textMode": "none",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
Expand Down Expand Up @@ -2204,7 +2204,7 @@
"fields": ""
},
"orientation": "horizontal",
"textMode": "<textMode>",
"textMode": "none",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
Expand Down Expand Up @@ -2280,7 +2280,7 @@
"fields": ""
},
"orientation": "horizontal",
"textMode": "<textMode>",
"textMode": "none",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
Expand Down Expand Up @@ -2356,7 +2356,7 @@
"fields": ""
},
"orientation": "horizontal",
"textMode": "<textMode>",
"textMode": "none",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
Expand Down Expand Up @@ -2432,7 +2432,7 @@
"fields": ""
},
"orientation": "horizontal",
"textMode": "<textMode>",
"textMode": "none",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
Expand Down Expand Up @@ -2522,7 +2522,7 @@
"fields": ""
},
"orientation": "horizontal",
"textMode": "<textMode>",
"textMode": "none",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
Expand Down Expand Up @@ -2598,7 +2598,7 @@
"fields": ""
},
"orientation": "horizontal",
"textMode": "<textMode>",
"textMode": "none",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
Expand Down Expand Up @@ -2674,7 +2674,7 @@
"fields": ""
},
"orientation": "horizontal",
"textMode": "<textMode>",
"textMode": "none",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
Expand Down Expand Up @@ -2750,7 +2750,7 @@
"fields": ""
},
"orientation": "horizontal",
"textMode": "<textMode>",
"textMode": "none",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
Expand Down Expand Up @@ -2804,7 +2804,7 @@
"color": "#ED8027"
},
{
"value": 24,
"value": 26,
"color": "#D44A3A"
}
]
Expand Down Expand Up @@ -2840,15 +2840,15 @@
"fields": ""
},
"orientation": "horizontal",
"textMode": "<textMode>",
"textMode": "value",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
},
"pluginVersion": "7.1.3",
"targets": [
{
"expr": "sum((time() - trackdb_refresh_timestamp) / (60*60) > 24) OR vector(0)",
"expr": "(time() - trackdb_refresh_timestamp) / (60*60)",
"legendFormat": "",
"interval": "",
"format": "time_series",
Expand Down Expand Up @@ -2916,7 +2916,7 @@
"fields": ""
},
"orientation": "horizontal",
"textMode": "<textMode>",
"textMode": "value",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
Expand Down
Loading

0 comments on commit 5038e72

Please sign in to comment.