Grafana: add nbc_peers

process_dashboard: add "--title" option
This commit is contained in:
Ștefan Talpalaru 2020-11-18 02:06:20 +01:00
parent 6b6e9b4d77
commit 2b2c717dd7
No known key found for this signature in database
GPG Key ID: CBF7934204F1B6F9
2 changed files with 17 additions and 5 deletions

View File

@ -45,7 +45,7 @@
"gnetId": null, "gnetId": null,
"graphTooltip": 0, "graphTooltip": 0,
"id": 25, "id": 25,
"iteration": 1601473231111, "iteration": 1605135683098,
"links": [], "links": [],
"panels": [ "panels": [
{ {
@ -717,6 +717,12 @@
"interval": "", "interval": "",
"legendFormat": "libp2p peers", "legendFormat": "libp2p peers",
"refId": "A" "refId": "A"
},
{
"expr": "nbc_peers{node=\"${node}\"}",
"interval": "",
"legendFormat": "beacon_node peers",
"refId": "B"
} }
], ],
"thresholds": [], "thresholds": [],
@ -2190,7 +2196,7 @@
] ]
}, },
"time": { "time": {
"from": "now-1h", "from": "now-24h",
"to": "now" "to": "now"
}, },
"timepicker": { "timepicker": {
@ -2210,5 +2216,5 @@
"timezone": "", "timezone": "",
"title": "NBC local testnet/sim (all nodes)", "title": "NBC local testnet/sim (all nodes)",
"uid": "pgeNfj2Wz2a", "uid": "pgeNfj2Wz2a",
"version": 4 "version": 9
} }

View File

@ -1,6 +1,6 @@
import json, parseopt, strutils import json, parseopt, strutils
# Usage: process_dashboard --in=local_dashboard.json --out=remote_dashboard.json --testnet=0 # Usage: process_dashboard --in=local_dashboard.json --out=remote_dashboard.json --testnet=3 --title="Nimbus Fleet Testnets"
# Import the result on metrics.status.im # Import the result on metrics.status.im
@ -8,6 +8,7 @@ var
p = initOptParser() p = initOptParser()
inputFileName, outputFilename: string inputFileName, outputFilename: string
testnet = 0 testnet = 0
title = ""
while true: while true:
p.next() p.next()
@ -21,6 +22,8 @@ while true:
outputFileName = p.val outputFileName = p.val
elif p.key == "testnet": elif p.key == "testnet":
testnet = p.val.parseInt() testnet = p.val.parseInt()
elif p.key == "title":
title = p.val
else: else:
echo "unsupported argument: ", p.key echo "unsupported argument: ", p.key
of cmdArgument: of cmdArgument:
@ -31,6 +34,9 @@ var
panels = inputData["panels"].copy() panels = inputData["panels"].copy()
outputData = inputData outputData = inputData
if title == "":
title = "Nimbus testnet" & $testnet
############# #############
# variables # # variables #
############# #############
@ -118,7 +124,7 @@ for panel in panels.mitems:
# misc # # misc #
######## ########
outputData["title"] = %* ("Nimbus testnet" & $testnet) outputData["title"] = %* $title
outputData["uid"] = %* (outputData["uid"].getStr()[0..^2] & $testnet) outputData["uid"] = %* (outputData["uid"].getStr()[0..^2] & $testnet)
# our annotations only work with a 1s resolution # our annotations only work with a 1s resolution
var annotation = outputData["annotations"]["list"][0].copy() var annotation = outputData["annotations"]["list"][0].copy()