Skip to content

Commit

Permalink
Add `info' member to C++ Benchmark type
Browse files Browse the repository at this point in the history
  • Loading branch information
Quincunx271 committed Aug 24, 2021
1 parent cab001e commit a8642dc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions extras/analyze/src/types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ void ev::defTypes(py::module &Mod) {
.def_property_readonly(
"blocks",
[](const Benchmark &Bench) { return BenchmarkBlocks{Bench.Blocks}; })
.def_property_readonly("info",
[](const Benchmark &Bench) -> py::dict {
using namespace pybind11::literals;

return py::dict("name"_a = Bench.Name);
})
.def("__repr__", [](const Benchmark &Bench) {
return "<Benchmark(name=" + Bench.Name + ", " +
std::to_string(Bench.Blocks.size()) + " blocks)>";
Expand Down

0 comments on commit a8642dc

Please sign in to comment.