Fix peer count in edge dashboard (#2090)

Fixes #2075
This commit is contained in:
Pankaj Garg 2018-12-10 14:24:32 -08:00 committed by GitHub
parent 094f0a8be3
commit bc96bd3410
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 42 additions and 3 deletions

View File

@ -15,8 +15,8 @@
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"id": 3,
"iteration": 1543087985461,
"id": 74,
"iteration": 1544477352265,
"links": [
{
"asDropdown": true,
@ -1541,6 +1541,44 @@
]
],
"tags": []
},
{
"groupBy": [
{
"params": [
"$__interval"
],
"type": "time"
},
{
"params": [
"null"
],
"type": "fill"
}
],
"hide": false,
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT mean(\"count\") AS \"peers\" FROM \"$testnet\".\"autogen\".\"counter-broadcast_service-num_peers\" WHERE $timeFilter GROUP BY time(1s) FILL(0)",
"rawQuery": true,
"refId": "C",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"value"
],
"type": "field"
},
{
"params": [],
"type": "mean"
}
]
],
"tags": []
}
],
"thresholds": [],
@ -5572,5 +5610,5 @@
"timezone": "",
"title": "Testnet Monitor (edge)",
"uid": "testnet-edge",
"version": 110
"version": 111
}

View File

@ -216,6 +216,7 @@ impl BroadcastService {
let mut tick_height_ = tick_height;
loop {
let broadcast_table = cluster_info.read().unwrap().tvu_peers();
inc_new_counter_info!("broadcast_service-num_peers", broadcast_table.len() + 1);
let leader_id = cluster_info.read().unwrap().leader_id();
if let Err(e) = broadcast(
max_tick_height,