Log fork stake-percentage in metrics, and display (#5406)
* Log fork stake percentage data * Add fork stake percentage to dashboard * Call out parent slot
This commit is contained in:
parent
ccc0f2d956
commit
92e419f1c7
|
@ -474,6 +474,37 @@ impl ReplayStage {
|
|||
total_epoch_stakes,
|
||||
stake_lockout.lockout(),
|
||||
);
|
||||
let percentage_stake: f64 =
|
||||
stake_lockout.stake() as f64 / total_epoch_stakes as f64;
|
||||
let fork_metrics = *fork as i64;
|
||||
let parent = w_bank_forks
|
||||
.get(*fork)
|
||||
.map(|bank| bank.parent().map(|parent| parent.slot()).unwrap_or(0))
|
||||
.unwrap_or(0) as i64;
|
||||
solana_metrics::submit(
|
||||
solana_metrics::influxdb::Point::new("stake-percentage")
|
||||
.add_tag(
|
||||
"fork_tag",
|
||||
solana_metrics::influxdb::Value::Integer(fork_metrics),
|
||||
)
|
||||
.add_field(
|
||||
"percentage_stake",
|
||||
solana_metrics::influxdb::Value::Float(percentage_stake),
|
||||
)
|
||||
.add_field(
|
||||
"fork",
|
||||
solana_metrics::influxdb::Value::Integer(fork_metrics),
|
||||
)
|
||||
.add_field("parent", solana_metrics::influxdb::Value::Integer(parent))
|
||||
.add_field(
|
||||
"root",
|
||||
solana_metrics::influxdb::Value::Integer(
|
||||
tower.root().unwrap_or(0) as i64
|
||||
),
|
||||
)
|
||||
.to_owned(),
|
||||
log::Level::Info,
|
||||
);
|
||||
}
|
||||
}
|
||||
drop(w_bank_forks);
|
||||
|
|
|
@ -7964,6 +7964,196 @@
|
|||
"align": false,
|
||||
"alignLevel": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"collapsed": false,
|
||||
"gridPos": {
|
||||
"h": 1,
|
||||
"w": 24,
|
||||
"x": 0,
|
||||
"y": 97
|
||||
},
|
||||
"id": 60,
|
||||
"panels": [],
|
||||
"title": "Fork Confidence",
|
||||
"type": "row"
|
||||
},
|
||||
{
|
||||
"collapsed": false,
|
||||
"gridPos": {
|
||||
"h": 1,
|
||||
"w": 24,
|
||||
"x": 0,
|
||||
"y": 97
|
||||
},
|
||||
"id": 61,
|
||||
"panels": [],
|
||||
"title": "Fork Confidence",
|
||||
"type": "row"
|
||||
},
|
||||
{
|
||||
"columns": [],
|
||||
"datasource": "$datasource",
|
||||
"fontSize": "100%",
|
||||
"gridPos": {
|
||||
"h": 9,
|
||||
"w": 12,
|
||||
"x": 0,
|
||||
"y": 98
|
||||
},
|
||||
"id": 62,
|
||||
"links": [],
|
||||
"pageSize": null,
|
||||
"scroll": true,
|
||||
"showHeader": true,
|
||||
"sort": {
|
||||
"col": 2,
|
||||
"desc": true
|
||||
},
|
||||
"styles": [
|
||||
{
|
||||
"alias": "Time",
|
||||
"dateFormat": "YYYY-MM-DD HH:mm:ss",
|
||||
"pattern": "Time",
|
||||
"type": "hidden"
|
||||
},
|
||||
{
|
||||
"alias": "",
|
||||
"colorMode": null,
|
||||
"colors": [
|
||||
"rgba(245, 54, 54, 0.9)",
|
||||
"rgba(237, 129, 40, 0.89)",
|
||||
"rgba(50, 172, 45, 0.97)"
|
||||
],
|
||||
"dateFormat": "YYYY-MM-DD HH:mm:ss",
|
||||
"decimals": 2,
|
||||
"mappingType": 1,
|
||||
"pattern": "fork_tag",
|
||||
"thresholds": [],
|
||||
"type": "hidden",
|
||||
"unit": "short"
|
||||
},
|
||||
{
|
||||
"alias": "Fork",
|
||||
"colorMode": null,
|
||||
"colors": [
|
||||
"rgba(245, 54, 54, 0.9)",
|
||||
"rgba(237, 129, 40, 0.89)",
|
||||
"rgba(50, 172, 45, 0.97)"
|
||||
],
|
||||
"dateFormat": "YYYY-MM-DD HH:mm:ss",
|
||||
"decimals": 0,
|
||||
"mappingType": 1,
|
||||
"pattern": "fork",
|
||||
"thresholds": [],
|
||||
"type": "number",
|
||||
"unit": "none"
|
||||
},
|
||||
{
|
||||
"alias": "# Nodes Reporting",
|
||||
"colorMode": null,
|
||||
"colors": [
|
||||
"rgba(245, 54, 54, 0.9)",
|
||||
"rgba(237, 129, 40, 0.89)",
|
||||
"rgba(50, 172, 45, 0.97)"
|
||||
],
|
||||
"dateFormat": "YYYY-MM-DD HH:mm:ss",
|
||||
"decimals": 0,
|
||||
"mappingType": 1,
|
||||
"pattern": "nodes_reporting",
|
||||
"thresholds": [],
|
||||
"type": "number",
|
||||
"unit": "none"
|
||||
},
|
||||
{
|
||||
"alias": "Mean Percentage Stake",
|
||||
"colorMode": null,
|
||||
"colors": [
|
||||
"rgba(245, 54, 54, 0.9)",
|
||||
"rgba(237, 129, 40, 0.89)",
|
||||
"rgba(50, 172, 45, 0.97)"
|
||||
],
|
||||
"dateFormat": "YYYY-MM-DD HH:mm:ss",
|
||||
"decimals": 0,
|
||||
"mappingType": 1,
|
||||
"pattern": "percentage_stake",
|
||||
"thresholds": [],
|
||||
"type": "number",
|
||||
"unit": "percentunit"
|
||||
},
|
||||
{
|
||||
"alias": "Parent",
|
||||
"colorMode": null,
|
||||
"colors": [
|
||||
"rgba(245, 54, 54, 0.9)",
|
||||
"rgba(237, 129, 40, 0.89)",
|
||||
"rgba(50, 172, 45, 0.97)"
|
||||
],
|
||||
"dateFormat": "YYYY-MM-DD HH:mm:ss",
|
||||
"decimals": 0,
|
||||
"mappingType": 1,
|
||||
"pattern": "parent",
|
||||
"thresholds": [],
|
||||
"type": "number",
|
||||
"unit": "none"
|
||||
},
|
||||
{
|
||||
"alias": "",
|
||||
"colorMode": null,
|
||||
"colors": [
|
||||
"rgba(245, 54, 54, 0.9)",
|
||||
"rgba(237, 129, 40, 0.89)",
|
||||
"rgba(50, 172, 45, 0.97)"
|
||||
],
|
||||
"decimals": 0,
|
||||
"pattern": "/.*/",
|
||||
"thresholds": [],
|
||||
"type": "number",
|
||||
"unit": "short"
|
||||
}
|
||||
],
|
||||
"targets": [
|
||||
{
|
||||
"groupBy": [
|
||||
{
|
||||
"params": [
|
||||
"$__interval"
|
||||
],
|
||||
"type": "time"
|
||||
},
|
||||
{
|
||||
"params": [
|
||||
"null"
|
||||
],
|
||||
"type": "fill"
|
||||
}
|
||||
],
|
||||
"orderByTime": "ASC",
|
||||
"policy": "default",
|
||||
"query": "SELECT mean(fork) as fork, mean(parent) as parent, mean(last) as percentage_stake, count(host_id) as nodes_reporting from (SELECT fork, parent, last, host_id from (SELECT fork, root, parent, last(percentage_stake) FROM \"$testnet\".\"autogen\".\"stake-percentage\" WHERE $timeFilter GROUP BY fork_tag, host_id) WHERE fork > root AND root != 0) GROUP BY fork_tag",
|
||||
"rawQuery": true,
|
||||
"refId": "A",
|
||||
"resultFormat": "table",
|
||||
"select": [
|
||||
[
|
||||
{
|
||||
"params": [
|
||||
"value"
|
||||
],
|
||||
"type": "field"
|
||||
},
|
||||
{
|
||||
"params": [],
|
||||
"type": "mean"
|
||||
}
|
||||
]
|
||||
],
|
||||
"tags": []
|
||||
}
|
||||
],
|
||||
"title": "Fork Percentage Stake",
|
||||
"transform": "table",
|
||||
"type": "table"
|
||||
}
|
||||
],
|
||||
"refresh": "60s",
|
||||
|
|
Loading…
Reference in New Issue