12 std::getenv(
"BB_USE_OP_COUNT_TIME") ==
nullptr ? false : std::string(
std::getenv(
"BB_USE_OP_COUNT_TIME")) ==
"1";
25 ss << std::this_thread::get_id();
26 counts.push_back({
key, ss.str(), count });
33 if (entry.count->count > 0) {
34 std::cout << entry.key <<
"\t" << entry.count->count <<
"\t[thread=" << entry.thread_id <<
"]" <<
std::endl;
36 if (entry.count->time > 0) {
37 std::cout << entry.key <<
"(t)\t" <<
static_cast<double>(entry.count->time) / 1000000.0
38 <<
"ms\t[thread=" << entry.thread_id <<
"]" <<
std::endl;
48 if (entry.count->count > 0) {
49 aggregate_counts[entry.key] += entry.count->count;
51 if (entry.count->time > 0) {
52 aggregate_counts[entry.key +
"(t)"] += entry.count->time;
55 return aggregate_counts;
67 os <<
std::endl << std::string(indent,
' ');
92 auto now = std::chrono::high_resolution_clock::now();
93 auto now_ns = std::chrono::time_point_cast<std::chrono::nanoseconds>(now);
98 auto now = std::chrono::high_resolution_clock::now();
99 auto now_ns = std::chrono::time_point_cast<std::chrono::nanoseconds>(now);
GlobalOpCountContainer GLOBAL_OP_COUNTS
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
std::map< std::string, std::size_t > get_aggregate_counts() const
void add_entry(const char *key, const std::shared_ptr< OpStats > &count)
std::vector< Entry > counts
void print_aggregate_counts(std::ostream &, size_t) const
~GlobalOpCountContainer()
OpCountTimeReporter(OpStats *stats)