[FR] Ability to register flags for custom Reporters
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
首先阅读现有的入口点 benchmark::Initialize、benchmark::RunSpecifiedBenchmarks 和 BenchmarkReporter,以及命令行标志如何选择内置 reporter。定义已注册的自定义 reporter 如何存储、选择和构造,然后验证无需将自定义 reporter 显式传递给 RunSpecifiedBenchmarks,即可通过标志选择它。
由索引模型根据 Issue 内容生成。
描述
Is your feature request related to a problem? Please describe.
If I create a custom BenchmarkReporter, I also have to instantiate it and pass it to the RunSpecifiedBenchmarks function.
int main(int argc, char** argv) {
benchmark::Initialize(&argc, argv);
BenchmarkReporter* reporter = new FooReporter();
benchmark::RunSpecifiedBenchmarks(&reporter);
benchmark::Shutdown();
}
Describe the solution you'd like
I would like to be able to easily configure a flag for my reporter such as --benchmark_format=foo.
int main(int argc, char** argv) {
benchmark::Initialize(&argc, argv);
benchmark::RegisterReporter("foo", [](){ return new FooReporter()})
benchmark::RunSpecifiedBenchmarks();
benchmark::Shutdown();
}
Describe alternatives you've considered
- I currently proxy to the default reporter while intercepting the Run results in my custom reporter, so mine always runs on top of the default behavior.
- have considered adding arg parsing to
main()but that is more convoluted.
Additional context
- I am interested in adding a custom reporter that asserts that the run results fall within some target performance threshold. I want to be able to optionally select this reporter at runtime with a flag. Built in support for assertions on a given threshold would be a welcome alternative.
- side note: it would be great to have an overload for
::benchmark::BenchmarkReporter::Run::GetAdjustedRealTime()that accepts a time unit.
- 主要语言
- C++
- 星标
- 10.5k
- 派生
- 1.8k
- 平均合并
- 1 天 15 小时
- 30 天内合并 PR
- 28
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
google/benchmark 的其他 Issue
-
[BUG] Confusing title in docs/platform_specific_build_instructions.md可能已有人在做 @skryabae 于 30 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 1 天内回复
-
[BUG] Memory manager counts allocations not part of benchmark可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
google/benchmark#2149 · 5 条评论 ·
维护者通常 1 天内回复
-
[FR] Add native Zig bindings via top-level `bindings/zig`可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 5/5 一周以上 新手友好度 42/100
google/benchmark#2266 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
google/benchmark#2235 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 20/100
google/benchmark#2195 · 3 条评论 ·
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 77/100
arvidn/libtorrent#9149 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
Niko1221/Strata#5560 · 2 条评论 ·
维护者通常 4 天内回复
-
NVIDIA windows
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
要トリアージ 辞書
难度 1/5 1-3 小时 新手友好度 86/100
yksr-melt/Meltype#1625 · 1 个 reaction ·
维护者通常 1 天内回复