17 "https://cdn.plot.ly/plotly-latest.min.js";
25 "List benchmarks without executing them. Can be combined " 26 "with -scaling and -filter",
30 strprintf(
"Number of measurement evaluations to perform. (default: %u)",
33 argsman.
AddArg(
"-filter=<regex>",
34 strprintf(
"Regular expression filter to select benchmark by " 40 strprintf(
"Scaling factor for benchmark's runtime (default: %u)",
44 "-printer=(console|junit|plot)",
45 strprintf(
"Choose printer format. console: print data to console. " 46 "junit: print results as a Junit compliant XML." 47 "plot: print results as HTML graph (default: %s)",
50 argsman.
AddArg(
"-plot-plotlyurl=<uri>",
51 strprintf(
"URL to use for plotly.js (default: %s)",
64 int main(
int argc,
char **argv) {
69 tfm::format(std::cerr,
"Error parsing command line arguments: %s\n",
82 bool is_list_only = argsman.
GetBoolArg(
"-list",
false);
84 if (evaluations == 0) {
86 }
else if (evaluations < 0) {
87 tfm::format(std::cerr,
"Error parsing evaluations argument: %d\n",
92 double scaling_factor;
94 tfm::format(std::cerr,
"Error parsing scaling factor as double: %s\n",
99 std::unique_ptr<benchmark::Printer> printer =
100 std::make_unique<benchmark::ConsolePrinter>();
102 if (
"plot" == printer_arg) {
108 if (
"junit" == printer_arg) {
117 regex_filter, is_list_only);
static const char * DEFAULT_BENCH_SCALING
static const char * DEFAULT_BENCH_PRINTER
NODISCARD bool ParseParameters(int argc, const char *const argv[], std::string &error)
bool GetBoolArg(const std::string &strArg, bool fDefault) const
Return boolean argument or default value.
std::string GetHelpMessage() const
Get the help string.
static const char * DEFAULT_BENCH_FILTER
static void SetupBenchArgs(ArgsManager &argsman)
static const int64_t DEFAULT_PLOT_HEIGHT
static const int64_t DEFAULT_PLOT_WIDTH
void AddArg(const std::string &name, const std::string &help, unsigned int flags, const OptionsCategory &cat)
Add argument.
bool HelpRequested(const ArgsManager &args)
void ClearArgs()
Clear available arguments.
static void RunAll(Printer &printer, uint64_t num_evals, double scaling, const std::string &filter, bool is_list_only)
bool ParseDouble(const std::string &str, double *out)
Convert string to double with strict parse error feedback.
static const char * DEFAULT_PLOT_PLOTLYURL
static const int64_t DEFAULT_BENCH_EVALUATIONS
std::string GetArg(const std::string &strArg, const std::string &strDefault) const
Return string argument or default value.
int main(int argc, char **argv)
void SetupHelpOptions(ArgsManager &args)
Add help options to the args manager.
bool error(const char *fmt, const Args &... args)