Skip to content

Commit a8642dc

Browse files
committed
Add `info' member to C++ Benchmark type
1 parent cab001e commit a8642dc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

extras/analyze/src/types.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,12 @@ void ev::defTypes(py::module &Mod) {
141141
.def_property_readonly(
142142
"blocks",
143143
[](const Benchmark &Bench) { return BenchmarkBlocks{Bench.Blocks}; })
144+
.def_property_readonly("info",
145+
[](const Benchmark &Bench) -> py::dict {
146+
using namespace pybind11::literals;
147+
148+
return py::dict("name"_a = Bench.Name);
149+
})
144150
.def("__repr__", [](const Benchmark &Bench) {
145151
return "<Benchmark(name=" + Bench.Name + ", " +
146152
std::to_string(Bench.Blocks.size()) + " blocks)>";

0 commit comments

Comments
 (0)