pull/2151/head
Siddharth Rakesh 10 years ago
parent 199ad685fd
commit ef3ca1b3bf
  1. 13
      test/cpp/qps/report.cc
  2. 3
      test/cpp/qps/report.h

@ -124,7 +124,7 @@ UserDataClient userDataClient(grpc::CreateChannel("localhost:50052", grpc::Insec
//Leaderboard Reported implementation. //Leaderboard Reported implementation.
void UserDatabaseReporter::ReportQPS(const ScenarioResult& result) const { void UserDatabaseReporter::ReportQPS(const ScenarioResult& result) const {
double qps = result.latencies.Count() / auto qps = result.latencies.Count() /
average(result.client_resources, average(result.client_resources,
[](ResourceUsage u) { return u.wall_time; }); [](ResourceUsage u) { return u.wall_time; });
@ -132,13 +132,12 @@ void UserDatabaseReporter::ReportQPS(const ScenarioResult& result) const {
userDataClient.setConfigs(result.client_config, result.server_config); userDataClient.setConfigs(result.client_config, result.server_config);
} }
void UserDatabaseReporter::ReportQPSPerCore(const ScenarioResult& result, void UserDatabaseReporter::ReportQPSPerCore(const ScenarioResult& result) const {
const ServerConfig& server_config) const { auto qps = result.latencies.Count() /
double qps = result.latencies.Count() / average(result.client_resources,
average(result.client_resources, [](ResourceUsage u) { return u.wall_time; });
[](ResourceUsage u) { return u.wall_time; });
double qpsPerCore = qps / server_config.threads(); auto qpsPerCore = qps / result.server_config.threads();
userDataClient.setQPSPerCore(qpsPerCore); userDataClient.setQPSPerCore(qpsPerCore);
userDataClient.setConfigs(result.client_config, result.server_config); userDataClient.setConfigs(result.client_config, result.server_config);

@ -114,8 +114,7 @@ class UserDatabaseReporter : public Reporter {
std::string access_token_; std::string access_token_;
std::string test_name_; std::string test_name_;
void ReportQPS(const ScenarioResult& result) const GRPC_OVERRIDE; void ReportQPS(const ScenarioResult& result) const GRPC_OVERRIDE;
void ReportQPSPerCore(const ScenarioResult& result, void ReportQPSPerCore(const ScenarioResult& result) const GRPC_OVERRIDE;
const ServerConfig& config) const GRPC_OVERRIDE;
void ReportLatency(const ScenarioResult& result) const GRPC_OVERRIDE; void ReportLatency(const ScenarioResult& result) const GRPC_OVERRIDE;
void ReportTimes(const ScenarioResult& result) const GRPC_OVERRIDE; void ReportTimes(const ScenarioResult& result) const GRPC_OVERRIDE;
void Flush() const; void Flush() const;

Loading…
Cancel
Save