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 a61e637
Show file tree
Hide file tree
Showing 2 changed files with 10 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
4 changes: 4 additions & 0 deletions util/analyze/_cpp_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ def blocks(self):
def raw_log(self):
return self.__cpp.raw_log

@property
def info(self):
return self.__cpp.info

# Inherit __iter__

# Inherit .benchmarks
Expand Down

0 comments on commit a61e637

Please sign in to comment.