diff --git a/book/src/performance-metrics.md b/book/src/performance-metrics.md index e6088ac711..a3390cbfef 100644 --- a/book/src/performance-metrics.md +++ b/book/src/performance-metrics.md @@ -11,7 +11,7 @@ it on the dashboard. ## TPS -The leader node's banking stage maintains a count of transactions that it processed. +The leader node's banking stage maintains a count of transactions that it recorded. The dashboard displays the count averaged over 2 second period in the TPS time series graph. The dashboard also shows per second mean, maximum and total TPS as a running counter. diff --git a/ci/testnet-automation.sh b/ci/testnet-automation.sh index f37bc9832f..d998494739 100755 --- a/ci/testnet-automation.sh +++ b/ci/testnet-automation.sh @@ -52,14 +52,14 @@ launchTestnet() { declare q_mean_tps=' SELECT round(mean("sum_count")) AS "mean_tps" FROM ( SELECT sum("count") AS "sum_count" - FROM "testnet-automation"."autogen"."banking_stage-process_transactions" + FROM "testnet-automation"."autogen"."banking_stage-record_transactions" WHERE time > now() - 300s GROUP BY time(1s) )' declare q_max_tps=' SELECT round(max("sum_count")) AS "max_tps" FROM ( SELECT sum("count") AS "sum_count" - FROM "testnet-automation"."autogen"."banking_stage-process_transactions" + FROM "testnet-automation"."autogen"."banking_stage-record_transactions" WHERE time > now() - 300s GROUP BY time(1s) )' diff --git a/core/src/bank_forks.rs b/core/src/bank_forks.rs index d420c037a9..e3d4c6be8c 100644 --- a/core/src/bank_forks.rs +++ b/core/src/bank_forks.rs @@ -114,13 +114,23 @@ impl BankForks { .banks .get(&root) .expect("root bank didn't exist in bank_forks"); + let root_tx_count = root_bank + .parents() + .last() + .map(|bank| bank.transaction_count()) + .unwrap_or(0); root_bank.squash(); + let new_tx_count = root_bank.transaction_count(); self.prune_non_root(root); inc_new_counter_info!( "bank-forks_set_root_ms", timing::duration_as_ms(&set_root_start.elapsed()) as usize ); + inc_new_counter_info!( + "bank-forks_set_root_tx_count", + (new_tx_count - root_tx_count) as usize + ); } pub fn root(&self) -> u64 { diff --git a/core/src/banking_stage.rs b/core/src/banking_stage.rs index b68b5e9734..97f3011681 100644 --- a/core/src/banking_stage.rs +++ b/core/src/banking_stage.rs @@ -357,6 +357,10 @@ impl BankingStage { debug!("processed: {} ", processed_transactions.len()); // unlock all the accounts with errors which are filtered by the above `filter_map` if !processed_transactions.is_empty() { + inc_new_counter_info!( + "banking_stage-record_transactions", + processed_transactions.len() + ); let hash = hash_transactions(&processed_transactions); // record and unlock will unlock all the successful transactions poh.lock() diff --git a/metrics/testnet-monitor.json b/metrics/testnet-monitor.json index ade19b4fdc..a37629939f 100644 --- a/metrics/testnet-monitor.json +++ b/metrics/testnet-monitor.json @@ -502,7 +502,7 @@ "hide": false, "orderByTime": "ASC", "policy": "default", - "query": "SELECT ROUND(MEAN(\"sum\")) FROM ( SELECT sum(\"count\") FROM \"$testnet\".\"autogen\".\"banking_stage-process_transactions\" WHERE $timeFilter GROUP BY time(1s) )\n\n", + "query": "SELECT ROUND(MEAN(\"sum\")) FROM ( SELECT sum(\"count\") FROM \"$testnet\".\"autogen\".\"banking_stage-record_transactions\" WHERE $timeFilter GROUP BY time(1s) )\n\n", "rawQuery": true, "refId": "A", "resultFormat": "time_series", @@ -614,7 +614,7 @@ "hide": false, "orderByTime": "ASC", "policy": "default", - "query": "SELECT MAX(\"sum\") FROM ( SELECT sum(\"count\") FROM \"$testnet\".\"autogen\".\"banking_stage-process_transactions\" WHERE $timeFilter GROUP BY time(1s) )\n\n", + "query": "SELECT MAX(\"sum\") FROM ( SELECT sum(\"count\") FROM \"$testnet\".\"autogen\".\"banking_stage-record_transactions\" WHERE $timeFilter GROUP BY time(1s) )\n\n", "rawQuery": true, "refId": "A", "resultFormat": "time_series", @@ -726,7 +726,7 @@ "hide": false, "orderByTime": "ASC", "policy": "default", - "query": "SELECT sum(\"count\") AS \"transactions\" FROM \"$testnet\".\"autogen\".\"banking_stage-process_transactions\" WHERE $timeFilter \n\n", + "query": "SELECT sum(\"count\") AS \"transactions\" FROM \"$testnet\".\"autogen\".\"banking_stage-record_transactions\" WHERE $timeFilter \n\n", "rawQuery": true, "refId": "A", "resultFormat": "time_series", @@ -1556,7 +1556,7 @@ ], "orderByTime": "ASC", "policy": "default", - "query": "SELECT sum(\"count\") / 2 AS \"transactions\" FROM \"$testnet\".\"autogen\".\"banking_stage-process_transactions\" WHERE $timeFilter GROUP BY time(2s) FILL(0)\n", + "query": "SELECT sum(\"count\") / 2 AS \"transactions\" FROM \"$testnet\".\"autogen\".\"banking_stage-record_transactions\" WHERE $timeFilter GROUP BY time(2s) FILL(0)\n", "rawQuery": true, "refId": "A", "resultFormat": "time_series",