Go to the documentation of this file.
15 #include "benchmark/benchmark.h"
43 #ifdef BENCHMARK_OS_WINDOWS
46 <<
"Color printing is only supported for stdout on windows."
47 " Disabling color printing\n";
57 "Benchmark",
"Time",
"CPU",
"Iterations");
58 if(!
run.counters.empty()) {
60 for(
auto const& c :
run.counters) {
64 str +=
" UserCounters...";
73 for (
const auto&
run : reports) {
102 typedef void(PrinterFn)(std::ostream&,
LogColor,
const char*, ...);
109 result.benchmark_name.c_str());
111 if (
result.error_occurred) {
112 printer(Out,
COLOR_RED,
"ERROR OCCURRED: \'%s\'",
113 result.error_message.c_str());
119 if (
result.bytes_per_second > 0) {
125 if (
result.items_per_second > 0) {
130 const double real_time =
result.GetAdjustedRealTime();
131 const double cpu_time =
result.GetAdjustedCPUTime();
133 if (
result.report_big_o) {
135 printer(Out,
COLOR_YELLOW,
"%10.2f %s %10.2f %s ", real_time, big_o.c_str(),
136 cpu_time, big_o.c_str());
137 }
else if (
result.report_rms) {
138 printer(Out,
COLOR_YELLOW,
"%10.0f %% %10.0f %% ", real_time * 100,
142 printer(Out,
COLOR_YELLOW,
"%10.0f %s %10.0f %s ", real_time, timeLabel,
143 cpu_time, timeLabel);
150 for (
auto& c :
result.counters) {
169 if (!
items.empty()) {
173 if (!
result.report_label.empty()) {
std::ostream & GetErrorStream() const
OutputOptions output_options_
virtual void ReportRuns(const std::vector< Run > &reports) BENCHMARK_OVERRIDE
virtual void PrintHeader(const Run &report)
const char * GetTimeUnitString(TimeUnit unit)
UserCounters prev_counters_
static void PrintBasicContext(std::ostream *out, Context const &context)
std::string FormatString(const char *msg, va_list args)
virtual void PrintRunData(const Run &report)
void ColorPrintf(std::ostream &out, LogColor color, const char *fmt,...)
std::string HumanReadableNumber(double n, double one_k)
std::string GetBigOString(BigO complexity)
GTEST_API_ const char * fmt
virtual bool ReportContext(const Context &context) BENCHMARK_OVERRIDE
static void IgnoreColorPrint(std::ostream &out, LogColor, const char *fmt,...)
grpc::ClientContext context
std::ostream & GetOutputStream() const
std::string StrCat(Args &&... args)
bool SameNames(UserCounters const &l, UserCounters const &r)
grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:01