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

blocks-import-script: add --csv-output flag #2982

Merged
merged 1 commit into from
Jan 4, 2025

Conversation

siddarthkay
Copy link
Contributor

@siddarthkay siddarthkay commented Jan 3, 2025

Summary

This PR adds --csv-output support to blocks import script.

Github renders CSVs as tables and this addition would be useful in nimbus-eth1-benchmark repo to make this comparison easy to render.

To see how github renders CSVs : https://github.com/status-im/nimbus-eth1-benchmarks/blob/master/short-benchmark/20241208T172603_9207eaf/blocks-import-benchmark.csv

This option can be used like this

python scripts/block-import-stats.py
short-benchmark/20241208T172603_9207eaf/blocks-import-benchmark.csv
short-benchmark/20241222T012247_aba9b582/blocks-import-benchmark.csv 
--csv-output output_stats.csv

I've also refactored to add a main() .
It would be easier to review this PR in Github by hiding whitespace like this https://github.com/status-im/nimbus-eth1/pull/2982/files?w=1

@siddarthkay siddarthkay marked this pull request as draft January 3, 2025 11:30
@siddarthkay siddarthkay force-pushed the support-csv-output-for-blocks-import branch from 652b6c3 to 326666c Compare January 3, 2025 12:14
@siddarthkay siddarthkay changed the title blocks-import-script: add --csv flag blocks-import-script: add --csv-output flag Jan 3, 2025
@siddarthkay siddarthkay force-pushed the support-csv-output-for-blocks-import branch from 326666c to bd87929 Compare January 3, 2025 13:03
@siddarthkay siddarthkay marked this pull request as ready for review January 3, 2025 13:06
@siddarthkay siddarthkay requested a review from jakubgs January 3, 2025 13:06
Comment on lines +178 to +192
print(f"\nblocks: {total_blocks}, baseline: {prettySecs(time_xt)}, contender: {prettySecs(time_yt)}")
print(f"Time (total): {prettySecs(timet)}, {(timet/time_xt):.2%}")
Copy link
Member

Choose a reason for hiding this comment

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

I think we might want to include these in the CSV file as well, possibly as extra columns.

It will cause data duplication, but it's better than adding weird rows that don't match column headers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh yes, I forgot we had discussed this today.
I'll update.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this looks much nicer

Screenshot 2025-01-04 at 10 02 58 PM

@siddarthkay siddarthkay force-pushed the support-csv-output-for-blocks-import branch from bd87929 to fcc21ea Compare January 4, 2025 16:35
@siddarthkay siddarthkay merged commit 7672f0b into master Jan 4, 2025
8 checks passed
@siddarthkay siddarthkay deleted the support-csv-output-for-blocks-import branch January 4, 2025 19:26
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.

3 participants