Skip to content

benchmark: exposed google benchmark's intrinsic command-line options - #15133

Merged
mattklein123 merged 4 commits into
envoyproxy:mainfrom
Razdeep:google_benchmark_options
Feb 25, 2021
Merged

mattklein123 merged 4 commits into
envoyproxy:mainfrom
Razdeep:google_benchmark_options

Conversation

@Razdeep

@Razdeep Razdeep commented Feb 22, 2021 •

Copy link
Copy Markdown
Contributor

Commit Message: benchmark: exposed google benchmark's intrinsic command-line options

Additional Description: If an argument containing the word "help" is passed, then it not
passed to the ::benchmark:Initialize() method, and handled separately.
This PR addresses Issue #15076.

Risk Level: Low
Testing: No
Docs Changes: No

Signed-off-by: Rajdeep Roy Chowdhury [email protected]

If an argument containing the word "help" is passed, then it not
passed to the ::benchmark:Initialize() method, and handled separately

Signed-off-by: Rajdeep Roy Chowdhury <[email protected]>

@antoniovicente antoniovicente left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks for the improvement to command line handling.

Comment thread test/benchmark/main.cc Outdated
}
}

if (!is_help_flag) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you add a comment explaining why --help needs to be treated in a special way?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

if we don't take care of the --help separately, then the output is actually "benchmark --help".

benchmark [--benchmark_list_tests={true|false}]
          [--benchmark_filter=<regex>]
          [--benchmark_min_time=<min_time>]
          [--benchmark_repetitions=<num_repetitions>]
          [--benchmark_report_aggregates_only={true|false}]
          [--benchmark_display_aggregates_only={true|false}]
          [--benchmark_format=<console|json|csv>]
          [--benchmark_out=<filename>]
          [--benchmark_out_format=<json|console|csv>]
          [--benchmark_color={auto|true|false}]
          [--benchmark_counters_tabular={true|false}]
          [--v=<verbosity>]

Here, the flag details like --skip_expensive_benchmarks and other custom-defined flags are missing.
That's why we are showing the older help results.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Preferring help documentation for the custom defined flags makes sense to me. Could you add a comment to the code that explains that we're checking for the --help flag in order to get that behavior?

Comment thread test/benchmark/main.cc Resolved
Comment thread test/benchmark/main.cc Resolved

@antoniovicente antoniovicente left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Change looks good.

The clang tidy check failure looks like noise, not sure what about your PR (if anything) triggered it.

Comment thread test/benchmark/main.cc Outdated
}
}

if (!is_help_flag) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Preferring help documentation for the custom defined flags makes sense to me. Could you add a comment to the code that explains that we're checking for the --help flag in order to get that behavior?

@antoniovicente antoniovicente left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the fix to flags handling.

@antoniovicente

Copy link
Copy Markdown
Contributor

@envoyproxy/senior-maintainers Could use your review. The clang-tidy breakage seems to be in base libraries and not really fixable.

@mattklein123 mattklein123 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

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