Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(synth-bench): automate TPS measurement for wait_until: NONE #12874

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

mooori
Copy link
Contributor

@mooori mooori commented Feb 4, 2025

As described in #12806, the RPC response to transactions sent with wait_until: NONE doesn't tell much. In that case, measuring TPS in terms of successfully processed transactions was a manual process. This PR automates it and uses that functionality for benchmarking native transfers.

Testing

  • Unit tests to verify metrics are extracted correctly from the report available under a nodes /metrics endpoint.
  • Running just benchmark_native_transfers prints TPS of successfully processed transactions.

Closes #12806

Copy link

codecov bot commented Feb 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.41%. Comparing base (7436639) to head (ecbd951).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12874      +/-   ##
==========================================
+ Coverage   70.25%   70.41%   +0.15%     
==========================================
  Files         854      855       +1     
  Lines      174571   174826     +255     
  Branches   174571   174826     +255     
==========================================
+ Hits       122646   123104     +458     
+ Misses      46713    46483     -230     
- Partials     5212     5239      +27     
Flag Coverage Δ
backward-compatibility 0.35% <ø> (?)
db-migration 0.35% <ø> (?)
genesis-check 1.40% <ø> (?)
linux 70.01% <ø> (+0.15%) ⬆️
linux-nightly 70.04% <ø> (-0.02%) ⬇️
pytests 1.71% <ø> (?)
sanity-checks 1.52% <ø> (?)
unittests 70.24% <ø> (-0.02%) ⬇️
upgradability 0.35% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

tokio = { version = "1.40.0", features = ["full"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"

[dev-dependencies]
indoc = "2"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is somewhat unfortunate that synth-bm is not part of the overall workspace. Any reason why you chose to have this crate be entirely separate?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC it was the quickest way to get started and then the question of including er excluding it didn't get enough attention. I can include it once the outstanding PRs are merged #12887.

impl MetricName {
fn report_name(self) -> &'static str {
match self {
MetricName::SuccessfulTransactions => "near_transaction_processed_successfully_total",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One important thing to keep in mind is that this metric is incremented when the transaction successfully converts into a receipt. It does not mean that the receipt is actually getting executed (it might even happen in a different block if the receipt gets delayed.) You will probably want a metric along the lines of near_action_called_count (allows determining the rate of actions based on action types even in mixed action workloads, or where receipts have multiple actions!) or receipts (I don't think we have a single metric for all of them together, but shouldn't be too hard to add up the delayed, local, incoming, etc. receipts.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting! We've been using near_transaction_processed_successfully_total for that purpose since the ft benchmarking days...

Will look into near_action_called_count.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

synth-bench: automate TPS measurement for wait_until: NONE
2 participants