diff options
author | Vijay Pai <vpai@google.com> | 2015-07-06 10:13:59 -0700 |
---|---|---|
committer | Vijay Pai <vpai@google.com> | 2015-07-06 10:13:59 -0700 |
commit | 775eaec77026ebb879c66f742bf03f99e50b2378 (patch) | |
tree | ef844fa6164d157ad6482c9d1b08181c5198d74f /test/cpp/util | |
parent | 8497c79155d47f2fb0f4765890ab259380c7749f (diff) | |
parent | a90c81ea61a736729598ae64c7c4a6ba2e2267ff (diff) |
Merge pull request #2151 from sidrakesh93/master
Changes required for reporting metrics to performance database server
Diffstat (limited to 'test/cpp/util')
-rw-r--r-- | test/cpp/util/benchmark_config.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/cpp/util/benchmark_config.cc b/test/cpp/util/benchmark_config.cc index 5b3c1daf5d..91fbbf9677 100644 --- a/test/cpp/util/benchmark_config.cc +++ b/test/cpp/util/benchmark_config.cc @@ -37,6 +37,18 @@ DEFINE_bool(enable_log_reporter, true, "Enable reporting of benchmark results through GprLog"); +DEFINE_bool(report_metrics_db, false, "True if metrics to be reported to performance database"); + +DEFINE_string(hashed_id, "", "Hash of the user id"); + +DEFINE_string(test_name, "", "Name of the test being executed"); + +DEFINE_string(sys_info, "", "System information"); + +DEFINE_string(server_address, "localhost:50052", "Address of the performance database server"); + +DEFINE_string(tag, "", "Optional tag for the test"); + // In some distros, gflags is in the namespace google, and in some others, // in gflags. This hack is enabling us to find both. namespace google {} @@ -57,6 +69,12 @@ static std::shared_ptr<Reporter> InitBenchmarkReporters() { composite_reporter->add( std::unique_ptr<Reporter>(new GprLogReporter("LogReporter"))); } + if(FLAGS_report_metrics_db) { + composite_reporter->add( + std::unique_ptr<Reporter>(new PerfDbReporter("PerfDbReporter", FLAGS_hashed_id, FLAGS_test_name, + FLAGS_sys_info, FLAGS_server_address, FLAGS_tag))); + } + return std::shared_ptr<Reporter>(composite_reporter); } |