Skip to content

Commit a61e637

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

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-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)>";

util/analyze/_cpp_types.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ def blocks(self):
6262
def raw_log(self):
6363
return self.__cpp.raw_log
6464

65+
@property
66+
def info(self):
67+
return self.__cpp.info
68+
6569
# Inherit __iter__
6670

6771
# Inherit .benchmarks

0 commit comments

Comments
 (0)