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

Add a customizable title to Metrics reporting #6792

Merged
merged 4 commits into from
Jul 30, 2024

Conversation

kripken
Copy link
Member

@kripken kripken commented Jul 30, 2024

Before the PR:

$ bin/wasm-opt test/hello_world.wat --metrics
total
 [exports]      : 1       
 [funcs]        : 1       
 [globals]      : 0       
 [imports]      : 0       
 [memories]     : 1       
 [memory-data]  : 0       
 [tables]       : 0       
 [tags]         : 0       
 [total]        : 3       
 [vars]         : 0       
 Binary         : 1       
 LocalGet       : 2       

After the PR:

$ bin/wasm-opt test/hello_world.wat --metrics
Metrics
total
 [exports]      : 1       
 [funcs]        : 1       
...

Note the "Metrics" addition at the top. And the title can be customized:

$ bin/wasm-opt test/hello_world.wat --metrics=text
Metrics: text
total
 [exports]      : 1       
 [funcs]        : 1       

The custom title can be helpful when multiple invocations of metrics are used
at once, e.g. --metrics=before -O3 --metrics=after.

This is now trivial to do, after #6687

cc @gkdn , I believe you asked for something like this in the past.

@kripken kripken requested a review from tlively July 30, 2024 17:48
@kripken kripken merged commit 5078d4d into WebAssembly:main Jul 30, 2024
13 checks passed
@kripken kripken deleted the metrics.title branch July 30, 2024 21:29
@gkdn gkdn mentioned this pull request Aug 31, 2024
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.

2 participants