aptos-core icon indicating copy to clipboard operation
aptos-core copied to clipboard

[cli][consensus] Add analyze-validator-performance to node cli

Open ikabiljo opened this issue 2 years ago • 2 comments

Adding utilities to analyze validator performance, based on accessing live on-chain data

Fastest to run a full node locally, and connecting cli to it.

Currently fetching from all transactions. We can fetch create API for just metadata transactions and/or fetch from BigQuery, if this is too slow for people. When we run loadtest, and BlockMetadata transactions are not the majority, it does slow down.

Test Plan: cargo run -p aptos -- node analyze-validator-performance --analyze-mode=all


This change is Reviewable

ikabiljo avatar Jul 29 '22 23:07 ikabiljo

@ikabiljo - Possible to split this into two PRs for easier review? I see its addressing two different functionalities one for each commit?

sitalkedia avatar Jul 30 '22 00:07 sitalkedia

sorry, github issues with stacked PRs.

Corrected it now, it's now showing only one change.

Other one is a separate PR already.

ikabiljo avatar Jul 30 '22 02:07 ikabiljo

Sorry, smoke_test was accidentally added, that's how I used it before extracting and putting into CLI, I'll remove it.

ikabiljo avatar Jul 31 '22 15:07 ikabiljo

other changes on main allowed me to simplify fetching logic (using fetching events). So this should also be faster now.

@sitalkedia , @zekun000 this is ready for review

ikabiljo avatar Aug 09 '22 22:08 ikabiljo

crates/aptos/src/node/mod.rs line 779 at r2 (raw file):

        }
        let all_validators: Vec<_> = total_stats.validator_stats.keys().cloned().collect();
        if self.analyze_mode == AnalyzeMode::ValidatorHealthOverTime

nit: A match statement would be cleaner to replace this if statement and statement below.

with match statement, I would need to duplicate the calls instead (because ALL calls both summaries - so seems like a similar complexity

ikabiljo avatar Aug 12 '22 15:08 ikabiljo

:white_check_mark: Forge test success on a501cc65a1f63f84a42a5a5420295e4d3e1b9117

performance benchmark : 7430 TPS, 3993 ms latency, 6000 ms p99 latency,no expired txns

github-actions[bot] avatar Aug 12 '22 19:08 github-actions[bot]