Skip to content

Commit 0e2b4d4

Browse files
vid277cdxker
authored andcommitted
fix: update default node dashboard + cargo fmt
1 parent 137f876 commit 0e2b4d4

2 files changed

Lines changed: 63 additions & 75 deletions

File tree

crates/node/src/handlers/consensus/handler.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,10 @@ impl ConsensusState {
213213
}
214214

215215
self.current_round = round - 1;
216-
current_round_metrics!(self.current_round, node.network_handle.peer_name(&node.peer_id));
216+
current_round_metrics!(
217+
self.current_round,
218+
node.network_handle.peer_name(&node.peer_id)
219+
);
217220

218221
self.start_new_round(node)
219222
}
@@ -224,7 +227,10 @@ impl ConsensusState {
224227
) -> Result<(), NodeError> {
225228
self.current_round += 1;
226229

227-
current_round_metrics!(self.current_round, node.network_handle.peer_name(&node.peer_id));
230+
current_round_metrics!(
231+
self.current_round,
232+
node.network_handle.peer_name(&node.peer_id)
233+
);
228234

229235
if let Some(new_leader) = self.select_leader(self.current_round) {
230236
self.proposer = Some(new_leader);
@@ -270,7 +276,10 @@ impl ConsensusState {
270276

271277
if announcement.round >= self.current_round {
272278
self.current_round = announcement.round;
273-
current_round_metrics!(self.current_round, node.network_handle.peer_name(&node.peer_id));
279+
current_round_metrics!(
280+
self.current_round,
281+
node.network_handle.peer_name(&node.peer_id)
282+
);
274283

275284
self.proposer = Some(leader);
276285
self.is_leader = leader == node.peer_id;

grafana/provisioning/dashboards/broadcast_dashboards/broadcast_routes.json

Lines changed: 51 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"editable": true,
1919
"fiscalYearStartMonth": 0,
2020
"graphTooltip": 0,
21-
"id": 1,
21+
"id": 6,
2222
"links": [],
2323
"panels": [
2424
{
@@ -84,9 +84,9 @@
8484
"h": 8,
8585
"w": 24,
8686
"x": 0,
87-
"y": 24
87+
"y": 0
8888
},
89-
"id": 5,
89+
"id": 1,
9090
"options": {
9191
"legend": {
9292
"calcs": [],
@@ -103,12 +103,17 @@
103103
"pluginVersion": "12.0.2",
104104
"targets": [
105105
{
106-
"expr": "current_round",
107-
"legendFormat": "{{instance}}",
106+
"expr": "broadcast_sent",
107+
"legendFormat": "{{instance}} - Sent: {{type}}",
108108
"refId": "A"
109+
},
110+
{
111+
"expr": "broadcast_received",
112+
"legendFormat": "{{instance}} - Received: {{type}}",
113+
"refId": "B"
109114
}
110115
],
111-
"title": "Current Consensus Round",
116+
"title": "Total Broadcast Messages by Type",
112117
"type": "timeseries"
113118
},
114119
{
@@ -174,9 +179,9 @@
174179
"h": 8,
175180
"w": 24,
176181
"x": 0,
177-
"y": 32
182+
"y": 8
178183
},
179-
"id": 6,
184+
"id": 2,
180185
"options": {
181186
"legend": {
182187
"calcs": [],
@@ -193,17 +198,12 @@
193198
"pluginVersion": "12.0.2",
194199
"targets": [
195200
{
196-
"expr": "broadcast_sent",
197-
"legendFormat": "Sent: {{type}}",
201+
"expr": "current_round",
202+
"legendFormat": "{{instance}}",
198203
"refId": "A"
199-
},
200-
{
201-
"expr": "broadcast_received",
202-
"legendFormat": "Received: {{type}}",
203-
"refId": "B"
204204
}
205205
],
206-
"title": "Total Broadcast Messages by Type",
206+
"title": "Current Consensus Round",
207207
"type": "timeseries"
208208
},
209209
{
@@ -269,9 +269,9 @@
269269
"h": 8,
270270
"w": 12,
271271
"x": 0,
272-
"y": 40
272+
"y": 16
273273
},
274-
"id": 7,
274+
"id": 3,
275275
"options": {
276276
"legend": {
277277
"calcs": [],
@@ -288,17 +288,17 @@
288288
"pluginVersion": "12.0.2",
289289
"targets": [
290290
{
291-
"expr": "broadcast_sent{instance=\"node1:8080\"}",
291+
"expr": "broadcast_sent{instance=~\".*node1.*\"}",
292292
"legendFormat": "Sent: {{type}}",
293293
"refId": "A"
294294
},
295295
{
296-
"expr": "broadcast_received{instance=\"node1:8080\"}",
296+
"expr": "broadcast_received{instance=~\".*node1.*\"}",
297297
"legendFormat": "Received: {{type}}",
298298
"refId": "B"
299299
}
300300
],
301-
"title": "Node 1 - Total Broadcast Messages",
301+
"title": "Node 1 - Broadcast Messages",
302302
"type": "timeseries"
303303
},
304304
{
@@ -364,9 +364,9 @@
364364
"h": 8,
365365
"w": 12,
366366
"x": 12,
367-
"y": 40
367+
"y": 16
368368
},
369-
"id": 8,
369+
"id": 4,
370370
"options": {
371371
"legend": {
372372
"calcs": [],
@@ -383,17 +383,17 @@
383383
"pluginVersion": "12.0.2",
384384
"targets": [
385385
{
386-
"expr": "broadcast_sent{instance=\"node2:8080\"}",
386+
"expr": "broadcast_sent{instance=~\".*node2.*\"}",
387387
"legendFormat": "Sent: {{type}}",
388388
"refId": "A"
389389
},
390390
{
391-
"expr": "broadcast_received{instance=\"node2:8080\"}",
391+
"expr": "broadcast_received{instance=~\".*node2.*\"}",
392392
"legendFormat": "Received: {{type}}",
393393
"refId": "B"
394394
}
395395
],
396-
"title": "Node 2 - Total Broadcast Messages",
396+
"title": "Node 2 - Broadcast Messages",
397397
"type": "timeseries"
398398
},
399399
{
@@ -459,9 +459,9 @@
459459
"h": 8,
460460
"w": 12,
461461
"x": 0,
462-
"y": 48
462+
"y": 24
463463
},
464-
"id": 9,
464+
"id": 5,
465465
"options": {
466466
"legend": {
467467
"calcs": [],
@@ -478,17 +478,17 @@
478478
"pluginVersion": "12.0.2",
479479
"targets": [
480480
{
481-
"expr": "broadcast_sent{instance=\"node3:8080\"}",
481+
"expr": "broadcast_sent{instance=~\".*node3.*\"}",
482482
"legendFormat": "Sent: {{type}}",
483483
"refId": "A"
484484
},
485485
{
486-
"expr": "broadcast_received{instance=\"node3:8080\"}",
486+
"expr": "broadcast_received{instance=~\".*node3.*\"}",
487487
"legendFormat": "Received: {{type}}",
488488
"refId": "B"
489489
}
490490
],
491-
"title": "Node 3 - Total Broadcast Messages",
491+
"title": "Node 3 - Broadcast Messages",
492492
"type": "timeseries"
493493
},
494494
{
@@ -554,9 +554,9 @@
554554
"h": 8,
555555
"w": 12,
556556
"x": 12,
557-
"y": 48
557+
"y": 24
558558
},
559-
"id": 10,
559+
"id": 6,
560560
"options": {
561561
"legend": {
562562
"calcs": [],
@@ -583,7 +583,7 @@
583583
"refId": "B"
584584
}
585585
],
586-
"title": "Node 4 - Total Broadcast Messages",
586+
"title": "Node 4 - Broadcast Messages",
587587
"type": "timeseries"
588588
},
589589
{
@@ -649,9 +649,9 @@
649649
"h": 8,
650650
"w": 12,
651651
"x": 0,
652-
"y": 56
652+
"y": 32
653653
},
654-
"id": 11,
654+
"id": 7,
655655
"options": {
656656
"legend": {
657657
"calcs": [],
@@ -668,17 +668,17 @@
668668
"pluginVersion": "12.0.2",
669669
"targets": [
670670
{
671-
"expr": "broadcast_sent{instance=\"node5:8080\"}",
671+
"expr": "broadcast_sent{instance=~\".*node5.*\"}",
672672
"legendFormat": "Sent: {{type}}",
673673
"refId": "A"
674674
},
675675
{
676-
"expr": "broadcast_received{instance=\"node5:8080\"}",
676+
"expr": "broadcast_received{instance=~\".*node5.*\"}",
677677
"legendFormat": "Received: {{type}}",
678678
"refId": "B"
679679
}
680680
],
681-
"title": "Node 5 - Total Broadcast Messages",
681+
"title": "Node 5 - Broadcast Messages",
682682
"type": "timeseries"
683683
},
684684
{
@@ -744,9 +744,9 @@
744744
"h": 8,
745745
"w": 24,
746746
"x": 0,
747-
"y": 64
747+
"y": 40
748748
},
749-
"id": 12,
749+
"id": 9,
750750
"options": {
751751
"legend": {
752752
"calcs": [],
@@ -763,13 +763,13 @@
763763
"pluginVersion": "12.0.2",
764764
"targets": [
765765
{
766-
"expr": "broadcast_sent",
767-
"legendFormat": "{{instance}} - Sent",
766+
"expr": "sum by (instance) (broadcast_sent)",
767+
"legendFormat": "{{instance}} - Total Sent",
768768
"refId": "A"
769769
},
770770
{
771-
"expr": "broadcast_received",
772-
"legendFormat": "{{instance}} - Received",
771+
"expr": "sum by (instance) (broadcast_received)",
772+
"legendFormat": "{{instance}} - Total Received",
773773
"refId": "B"
774774
}
775775
],
@@ -783,42 +783,21 @@
783783
"templating": {
784784
"list": [
785785
{
786-
"name": "route",
787-
"type": "query",
788-
"datasource": {
789-
"type": "prometheus",
790-
"uid": "PBFA97CFB590B2093"
791-
},
792-
"definition": "label_values(grpc_requests_total, route)",
793-
"query": "label_values(grpc_requests_total, route)",
794-
"includeAll": true,
795-
"multi": true,
796-
"refresh": 2,
797786
"current": {
798-
"selected": true,
799787
"text": "All",
800788
"value": "$__all"
801-
}
802-
},
803-
{
804-
"name": "broadcast_type",
805-
"type": "query",
789+
},
806790
"datasource": {
807791
"type": "prometheus",
808792
"uid": "PBFA97CFB590B2093"
809793
},
810-
"definition": "label_values(broadcast_sent, type)",
811-
"query": "label_values(broadcast_sent, type)",
794+
"definition": "label_values(grpc_requests_total, route)",
812795
"includeAll": true,
813796
"multi": true,
797+
"name": "route",
798+
"query": "label_values(grpc_requests_total, route)",
814799
"refresh": 2,
815-
"regex": "",
816-
"sort": 0,
817-
"current": {
818-
"selected": true,
819-
"text": "All",
820-
"value": "$__all"
821-
}
800+
"type": "query"
822801
}
823802
]
824803
},
@@ -830,5 +809,5 @@
830809
"timezone": "browser",
831810
"title": "Broadcast Metrics",
832811
"uid": "de204051-ea04-446c-903e-e58aa091ec7c",
833-
"version": 5
812+
"version": 40
834813
}

0 commit comments

Comments
 (0)