Skip to content

Commit

Permalink
fix(pruner): highest pruned block metric (#7441)
Browse files Browse the repository at this point in the history
  • Loading branch information
shekhirin authored Apr 3, 2024
1 parent 57ee0c3 commit 4a8d2f4
Show file tree
Hide file tree
Showing 2 changed files with 133 additions and 24 deletions.
13 changes: 8 additions & 5 deletions crates/prune/src/pruner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,14 @@ impl<DB: Database> Pruner<DB> {
.get_prune_segment_metrics(segment.segment())
.duration_seconds
.record(segment_start.elapsed());

self.metrics
.get_prune_segment_metrics(segment.segment())
.highest_pruned_block
.set(to_block as f64);
if let Some(highest_pruned_block) =
output.checkpoint.and_then(|checkpoint| checkpoint.block_number)
{
self.metrics
.get_prune_segment_metrics(segment.segment())
.highest_pruned_block
.set(highest_pruned_block as f64);
}

progress = output.progress;

Expand Down
144 changes: 125 additions & 19 deletions etc/grafana/dashboards/overview.json
Original file line number Diff line number Diff line change
Expand Up @@ -7038,7 +7038,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
Expand Down Expand Up @@ -7213,7 +7214,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
Expand Down Expand Up @@ -7310,7 +7312,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
Expand Down Expand Up @@ -7407,7 +7410,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
Expand Down Expand Up @@ -7517,7 +7521,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
Expand Down Expand Up @@ -7614,7 +7619,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
Expand Down Expand Up @@ -7663,13 +7669,107 @@
"title": "Pruner duration, per segment",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": true,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 256
},
"id": 217,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "code",
"expr": "reth_pruner_segments_highest_pruned_block{instance=~\"$instance\"}",
"instant": false,
"legendFormat": "{{segment}}",
"range": true,
"refId": "A"
}
],
"title": "Highest pruned block, per segment",
"type": "timeseries"
},
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 256
"y": 264
},
"id": 108,
"panels": [],
Expand Down Expand Up @@ -7724,7 +7824,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
Expand Down Expand Up @@ -7766,7 +7867,7 @@
"h": 8,
"w": 12,
"x": 0,
"y": 257
"y": 265
},
"id": 109,
"options": {
Expand Down Expand Up @@ -7829,7 +7930,7 @@
"h": 8,
"w": 12,
"x": 12,
"y": 257
"y": 265
},
"id": 111,
"maxDataPoints": 25,
Expand Down Expand Up @@ -7941,7 +8042,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
Expand All @@ -7958,7 +8060,7 @@
"h": 8,
"w": 12,
"x": 0,
"y": 265
"y": 273
},
"id": 120,
"options": {
Expand Down Expand Up @@ -8017,7 +8119,7 @@
"h": 8,
"w": 12,
"x": 12,
"y": 265
"y": 273
},
"id": 112,
"maxDataPoints": 25,
Expand Down Expand Up @@ -8129,7 +8231,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
Expand Down Expand Up @@ -8170,7 +8273,7 @@
"h": 8,
"w": 12,
"x": 0,
"y": 273
"y": 281
},
"id": 198,
"options": {
Expand Down Expand Up @@ -8302,6 +8405,7 @@
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
Expand Down Expand Up @@ -8337,23 +8441,25 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "reqps"
"unit": "reqps",
"unitScale": true
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 273
"y": 281
},
"id": 213,
"options": {
Expand Down Expand Up @@ -8471,6 +8577,6 @@
"timezone": "",
"title": "reth",
"uid": "2k8BXz24x",
"version": 4,
"version": 5,
"weekStart": ""
}

0 comments on commit 4a8d2f4

Please sign in to comment.