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

View File

@ -1,6 +1,6 @@
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
@ -8,6 +8,7 @@ var
p = initOptParser()
inputFileName, outputFilename: string
testnet = 0
title = ""
while true:
p.next()
@ -21,6 +22,8 @@ while true:
outputFileName = p.val
elif p.key == "testnet":
testnet = p.val.parseInt()
elif p.key == "title":
title = p.val
else:
echo "unsupported argument: ", p.key
of cmdArgument:
@ -31,6 +34,9 @@ var
panels = inputData["panels"].copy()
outputData = inputData
if title == "":
title = "Nimbus testnet" & $testnet
#############
# variables #
#############
@ -118,7 +124,7 @@ for panel in panels.mitems:
# misc #
########
outputData["title"] = %* ("Nimbus testnet" & $testnet)
outputData["title"] = %* $title
outputData["uid"] = %* (outputData["uid"].getStr()[0..^2] & $testnet)
# our annotations only work with a 1s resolution
var annotation = outputData["annotations"]["list"][0].copy()