From 922ea81877fc8b0676ae90d59a3caad9954e2feb Mon Sep 17 00:00:00 2001 From: Siddharth Rakesh Date: Thu, 4 Jun 2015 17:32:31 -0700 Subject: QPS, latencies recorded with authentication --- test/cpp/util/benchmark_config.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/cpp/util/benchmark_config.cc') diff --git a/test/cpp/util/benchmark_config.cc b/test/cpp/util/benchmark_config.cc index 5b3c1daf5d..b68822436d 100644 --- a/test/cpp/util/benchmark_config.cc +++ b/test/cpp/util/benchmark_config.cc @@ -37,6 +37,8 @@ DEFINE_bool(enable_log_reporter, true, "Enable reporting of benchmark results through GprLog"); +DEFINE_string(access_token, "", "Authorizing JSON string for leaderboard"); + // 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 +59,10 @@ static std::shared_ptr InitBenchmarkReporters() { composite_reporter->add( std::unique_ptr(new GprLogReporter("LogReporter"))); } + if(!FLAGS_access_token.empty()) + composite_reporter->add( + std::unique_ptr(new UserDatabaseReporter("UserDataReporter", FLAGS_access_token))); + return std::shared_ptr(composite_reporter); } -- cgit v1.2.3 From 39824335ea2d29ab627a8accb8e12c3bd50352ad Mon Sep 17 00:00:00 2001 From: Siddharth Rakesh Date: Mon, 8 Jun 2015 13:44:51 -0700 Subject: Newer version --- test/cpp/qps/report.cc | 54 ++++----------- test/cpp/qps/report.h | 6 +- test/cpp/qps/run_auth_test.py | 135 ++++++++++++++++++++++++++++++++++++++ test/cpp/qps/user_data.proto | 55 +++++++++++----- test/cpp/qps/user_data_client.cc | 62 ++++++++++------- test/cpp/qps/user_data_client.h | 51 +++++++------- test/cpp/util/benchmark_config.cc | 4 +- 7 files changed, 258 insertions(+), 109 deletions(-) create mode 100644 test/cpp/qps/run_auth_test.py (limited to 'test/cpp/util/benchmark_config.cc') diff --git a/test/cpp/qps/report.cc b/test/cpp/qps/report.cc index b4229889ad..124bdc70fd 100644 --- a/test/cpp/qps/report.cc +++ b/test/cpp/qps/report.cc @@ -130,19 +130,8 @@ void UserDatabaseReporter::ReportQPS(const ScenarioResult& result) const { average(result.client_resources, [](ResourceUsage u) { return u.wall_time; }); - userDataClient.setAccessToken(access_token_); userDataClient.setQPS(qps); - - int userDataState = userDataClient.sendDataIfReady(); - - switch(userDataState) { - case 1: - gpr_log(GPR_INFO, "Data sent to user database successfully"); - break; - case -1: - gpr_log(GPR_INFO, "Data could not be sent to user database"); - break; - } + userDataClient.setConfigs(result.client_config, result.server_config); } void UserDatabaseReporter::ReportQPSPerCore(const ScenarioResult& result, @@ -153,40 +142,17 @@ void UserDatabaseReporter::ReportQPSPerCore(const ScenarioResult& result, double qpsPerCore = qps / server_config.threads(); - userDataClient.setAccessToken(access_token_); - //TBD userDataClient.setQPSPerCore(qpsPerCore); - - int userDataState = userDataClient.sendDataIfReady(); - - switch(userDataState) { - case 1: - gpr_log(GPR_INFO, "Data sent to user database successfully"); - break; - case -1: - gpr_log(GPR_INFO, "Data could not be sent to user database"); - break; - } + userDataClient.setConfigs(result.client_config, result.server_config); } void UserDatabaseReporter::ReportLatency(const ScenarioResult& result) const { - userDataClient.setAccessToken(access_token_); userDataClient.setLatencies(result.latencies.Percentile(50) / 1000, - result.latencies.Percentile(90) / 1000, - result.latencies.Percentile(95) / 1000, - result.latencies.Percentile(99) / 1000, - result.latencies.Percentile(99.9) / 1000); - - int userDataState = userDataClient.sendDataIfReady(); - - switch(userDataState) { - case 1: - gpr_log(GPR_INFO, "Data sent to user database successfully"); - break; - case -1: - gpr_log(GPR_INFO, "Data could not be sent to user database"); - break; - } + result.latencies.Percentile(90) / 1000, + result.latencies.Percentile(95) / 1000, + result.latencies.Percentile(99) / 1000, + result.latencies.Percentile(99.9) / 1000); + userDataClient.setConfigs(result.client_config, result.server_config); } void UserDatabaseReporter::ReportTimes(const ScenarioResult& result) const { @@ -207,11 +173,13 @@ void UserDatabaseReporter::ReportTimes(const ScenarioResult& result) const { sum(result.client_resources, [](ResourceUsage u) { return u.wall_time; }); - userDataClient.setAccessToken(access_token_); userDataClient.setTimes(serverSystemTime, serverUserTime, clientSystemTime, clientUserTime); + userDataClient.setConfigs(result.client_config, result.server_config); +} - int userDataState = userDataClient.sendDataIfReady(); +void UserDatabaseReporter::Flush() const { + int userDataState = userDataClient.sendData(access_token_, test_name_); switch(userDataState) { case 1: diff --git a/test/cpp/qps/report.h b/test/cpp/qps/report.h index 2e5b627e58..8a1ce2dabc 100644 --- a/test/cpp/qps/report.h +++ b/test/cpp/qps/report.h @@ -109,15 +109,19 @@ class GprLogReporter : public Reporter { /** Reporter for client leaderboard. */ class UserDatabaseReporter : public Reporter { public: - UserDatabaseReporter(const string& name, const string& access_token) : Reporter(name), access_token_(access_token) {} + UserDatabaseReporter(const string& name, const string& access_token, + const string& test_name) : Reporter(name), access_token_(access_token), test_name_(test_name) {} + ~UserDatabaseReporter() { Flush(); }; private: std::string access_token_; + std::string test_name_; void ReportQPS(const ScenarioResult& result) const GRPC_OVERRIDE; void ReportQPSPerCore(const ScenarioResult& result, const ServerConfig& config) const GRPC_OVERRIDE; void ReportLatency(const ScenarioResult& result) const GRPC_OVERRIDE; void ReportTimes(const ScenarioResult& result) const GRPC_OVERRIDE; + void Flush() const; }; } // namespace testing diff --git a/test/cpp/qps/run_auth_test.py b/test/cpp/qps/run_auth_test.py new file mode 100644 index 0000000000..3ed2a7c980 --- /dev/null +++ b/test/cpp/qps/run_auth_test.py @@ -0,0 +1,135 @@ +#!/usr/bin/python + +import os +import sys +import re +import urllib2 +import urllib +import json +import time +import subprocess + +CLIENT_ID = '1018396037782-tv81fshn76nemr24uuhuginceb9hni2m.apps.googleusercontent.com' +CLIENT_SECRET = '_HGHXg4DAA59r4w4x8p6ARzD' +GRANT_TYPE = 'http://oauth.net/grant_type/device/1.0' +ACCESS_TOKENS_DIR = '/tmp/auth_lead_access_tokens' +AUTH_TOKEN_LINK = 'https://www.googleapis.com/oauth2/v3/token' +GOOGLE_ACCOUNTS_LINK = 'https://accounts.google.com/o/oauth2/device/code' +USER_INFO_LINK = 'https://www.googleapis.com/oauth2/v1/userinfo' + +def fetchJSON(url, paramDict): + if len(paramDict) == 0: + req = urllib2.Request(url) + else: + data = urllib.urlencode(paramDict) + req = urllib2.Request(url, data) + + try: + response = urllib2.urlopen(req) + result = response.read() + + except urllib2.HTTPError, error: + result = error.read() + + return result + +def getUserInfo(accessToken): + url = USER_INFO_LINK + '?access_token=' + accessToken + paramDict = {} + JSONBody = fetchJSON(url, paramDict) + data = json.loads(JSONBody) + + return data + +def isAccessTokenValid(accessToken): + data = getUserInfo(accessToken); + + if 'id' in data: + return True + else: + return False + +def getUserId(accessToken): + data = getUserInfo(accessToken) + + email = data['email'] + email = email.split('@')[0].lower() + userId = re.sub('[.]', '', email) + + return userId + +def useAccessToken(userTokFile): + with open(userTokFile, "r") as data_file: + data = json.load(data_file) + accessToken = data["access_token"] + + if not isAccessTokenValid(accessToken): + return refreshAccessToken(data["refresh_token"], userTokFile) + + return accessToken + +def refreshAccessToken(refreshToken, userTokFile): + paramDict = {'refresh_token':refreshToken, 'client_id':CLIENT_ID, 'client_secret':CLIENT_SECRET, 'grant_type':'refresh_token'} + JSONBody = fetchJSON(AUTH_TOKEN_LINK, paramDict) + data = json.loads(JSONBody) + if not 'access_token' in data: + return reauthenticate() + else: + tokenData = {} + + with open(userTokFile, "r") as data_file: + tokenData = json.load(data_file) + + with open(userTokFile, "w") as data_file: + tokenData['access_token'] = data['access_token'] + json.dump(tokenData, data_file) + + return data['access_token'] + +def reauthenticate(): + paramDict = {'client_id':CLIENT_ID, 'scope':'email profile'} + JSONBody = fetchJSON(GOOGLE_ACCOUNTS_LINK, paramDict) + data = json.loads(JSONBody) + + print 'User authorization required\n' + print 'Please use the following code in you browser: ', data['user_code'] + print 'Verification URL: ', data['verification_url'] + print '\nAwaiting user authorization. May take a few more seconds after authorizing...\n' + + authData = {} + + while not 'access_token' in authData: + authDict = {'client_id':CLIENT_ID, 'client_secret':CLIENT_SECRET, 'code':data['device_code'], 'grant_type':GRANT_TYPE} + JSONBody = fetchJSON(AUTH_TOKEN_LINK, authDict) + authData = json.loads(JSONBody) + time.sleep(data['interval']) + + newUserTokFile = ACCESS_TOKENS_DIR + '/' + getUserId(authData['access_token']) + + with open(newUserTokFile, "w") as data_file: + json.dump(authData, data_file) + + return authData['access_token'] + +def main(): + if not os.path.exists(ACCESS_TOKENS_DIR): + os.makedirs(ACCESS_TOKENS_DIR) + + email = sys.argv[2] + email = email.split('@')[0].lower() + userId = re.sub('[.]', '', email) + + userTokFile = ACCESS_TOKENS_DIR + '/' + userId + + accessToken = '' + + if os.path.exists(userTokFile): + accessToken = useAccessToken(userTokFile) + else: + accessToken = reauthenticate() + + testName = sys.argv[1].split('/')[-1] + subprocess.call([sys.argv[1], '--access_token='+accessToken, '--test_name='+testName]) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/test/cpp/qps/user_data.proto b/test/cpp/qps/user_data.proto index 9c941cae2c..27d0049cf0 100644 --- a/test/cpp/qps/user_data.proto +++ b/test/cpp/qps/user_data.proto @@ -29,7 +29,9 @@ syntax = "proto2"; -package UserData; +import "test/cpp/qps/qpstest.proto"; + +package grpc.testing; service UserDataTransfer { // Sends client info @@ -42,37 +44,56 @@ service UserDataTransfer { //Metrics to be stored message Metrics { - required double qps = 1; - required double perc_lat_50 = 2; - required double perc_lat_90 = 3; - required double perc_lat_95 = 4; - required double perc_lat_99 = 5; - required double perc_lat_99_point_9 = 6; + optional double qps = 1; + optional double qps_per_core = 2; + optional double perc_lat_50 = 3; + optional double perc_lat_90 = 4; + optional double perc_lat_95 = 5; + optional double perc_lat_99 = 6; + optional double perc_lat_99_point_9 = 7; + optional double server_system_time = 8; + optional double server_user_time = 9; + optional double client_system_time = 10; + optional double client_user_time = 11; } //Timestamped details message DataDetails { - required string timestamp = 1; - required Metrics metrics = 2; + optional string timestamp = 1; + optional string test_name = 2; + optional Metrics metrics = 3; + optional ClientConfig client_config = 4; + optional ServerConfig server_config = 5; } //User details message UserDetails { - required string id = 1; - required string name = 2; - required string link = 3; + optional string id = 1; + optional string email = 2; + optional bool verified_email = 3; + optional string name = 4; + optional string given_name = 5; + optional string family_name = 6; + optional string link = 7; + optional string picture = 8; + optional string gender = 9; + optional string locale = 10; + optional string hd = 11; } //Stored to database message SingleUserDetails { repeated DataDetails data_details = 1; - required UserDetails user_details = 2; + optional UserDetails user_details = 2; } //Request for storing a single user's data message SingleUserRecordRequest { - required string access_token = 1; - required Metrics metrics = 2; + optional string access_token = 1; + optional string test_name = 2; + optional Metrics metrics = 3; + optional ClientConfig client_config = 4; + optional ServerConfig server_config = 5; } //Reply to request for storing single user's data @@ -81,12 +102,12 @@ message SingleUserRecordReply { //Request for retrieving single user's data message SingleUserRetrieveRequest { - required string client_id = 1; + optional string user_id = 1; } //Reply for request to retrieve single user's data message SingleUserRetrieveReply { - required SingleUserDetails details = 1; + optional SingleUserDetails details = 1; } //Request for retrieving all users' data diff --git a/test/cpp/qps/user_data_client.cc b/test/cpp/qps/user_data_client.cc index 20ce6d9c09..50b74276d2 100644 --- a/test/cpp/qps/user_data_client.cc +++ b/test/cpp/qps/user_data_client.cc @@ -33,17 +33,20 @@ #include "user_data_client.h" -void UserDataClient::setAccessToken(std::string access_token) { - access_token_ = access_token; +namespace grpc { +namespace testing { + +void UserDataClient::setConfigs(const ClientConfig& clientConfig, const ServerConfig& serverConfig) { + clientConfig_ = clientConfig; + serverConfig_ = serverConfig; } void UserDataClient::setQPS(double QPS) { QPS_ = QPS; - qpsSet = true; } -void UserDataClient::setQPSPerCore(double qpsPerCore) { - //TBD +void UserDataClient::setQPSPerCore(double QPSPerCore) { + QPSPerCore_ = QPSPerCore; } void UserDataClient::setLatencies(double percentileLatency50, double percentileLatency90, @@ -53,29 +56,37 @@ void UserDataClient::setLatencies(double percentileLatency50, double percentileL percentileLatency95_ = percentileLatency95; percentileLatency99_ = percentileLatency99; percentileLatency99Point9_ = percentileLatency99Point9; - - latenciesSet = true; } void UserDataClient::setTimes(double serverSystemTime, double serverUserTime, double clientSystemTime, double clientUserTime) { - //TBD + serverSystemTime_ = serverSystemTime; + serverUserTime_ = serverUserTime; + clientSystemTime_ = clientSystemTime; + clientUserTime_ = clientUserTime; } -int UserDataClient::sendDataIfReady() { - if(!(qpsSet && latenciesSet)) - return 0; +int UserDataClient::sendData(std::string access_token, std::string test_name) { SingleUserRecordRequest singleUserRecordRequest; - singleUserRecordRequest.set_access_token(access_token_); + singleUserRecordRequest.set_access_token(access_token); + singleUserRecordRequest.set_test_name(test_name); + *(singleUserRecordRequest.mutable_client_config()) = clientConfig_; + *(singleUserRecordRequest.mutable_server_config()) = serverConfig_; Metrics* metrics = singleUserRecordRequest.mutable_metrics(); - metrics->set_qps(QPS_); - metrics->set_perc_lat_50(percentileLatency50_); - metrics->set_perc_lat_90(percentileLatency90_); - metrics->set_perc_lat_95(percentileLatency95_); - metrics->set_perc_lat_99(percentileLatency99_); - metrics->set_perc_lat_99_point_9(percentileLatency99Point9_); + + if(QPS_ != DBL_MIN) metrics->set_qps(QPS_); + if(QPSPerCore_ != DBL_MIN) metrics->set_qps_per_core(QPSPerCore_); + if(percentileLatency50_ != DBL_MIN) metrics->set_perc_lat_50(percentileLatency50_); + if(percentileLatency90_ != DBL_MIN) metrics->set_perc_lat_90(percentileLatency90_); + if(percentileLatency95_ != DBL_MIN) metrics->set_perc_lat_95(percentileLatency95_); + if(percentileLatency99_ != DBL_MIN) metrics->set_perc_lat_99(percentileLatency99_); + if(percentileLatency99Point9_ != DBL_MIN) metrics->set_perc_lat_99_point_9(percentileLatency99Point9_); + if(serverSystemTime_ != DBL_MIN) metrics->set_server_system_time(serverSystemTime_); + if(serverUserTime_ != DBL_MIN) metrics->set_server_user_time(serverUserTime_); + if(clientSystemTime_ != DBL_MIN) metrics->set_client_system_time(clientSystemTime_); + if(clientUserTime_ != DBL_MIN) metrics->set_client_user_time(clientUserTime_); SingleUserRecordReply singleUserRecordReply; ClientContext context; @@ -90,11 +101,14 @@ int UserDataClient::sendDataIfReady() { // Get current date/time, format is YYYY-MM-DD.HH:mm:ss const std::string currentDateTime() { - time_t now = time(0); - struct tm tstruct; - char buf[80]; - tstruct = *localtime(&now); + time_t now = time(0); + struct tm tstruct; + char buf[80]; + tstruct = *localtime(&now); - strftime(buf, sizeof(buf), "%Y/%m/%d, %X", &tstruct); - return buf; + strftime(buf, sizeof(buf), "%Y/%m/%d, %X", &tstruct); + return buf; +} + +} } \ No newline at end of file diff --git a/test/cpp/qps/user_data_client.h b/test/cpp/qps/user_data_client.h index ec3dcb5d44..0186ec9071 100644 --- a/test/cpp/qps/user_data_client.h +++ b/test/cpp/qps/user_data_client.h @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -44,27 +45,22 @@ #include #include "test/cpp/qps/user_data.grpc.pb.h" -using grpc::ChannelArguments; -using grpc::ChannelInterface; -using grpc::ClientContext; -using grpc::Status; -using UserData::UserDataTransfer; -using UserData::Metrics; -using UserData::SingleUserRecordRequest; -using UserData::SingleUserRecordReply; + +namespace grpc{ +namespace testing { class UserDataClient { - public: +public: UserDataClient(std::shared_ptr channel) : stub_(UserDataTransfer::NewStub(channel)) {} ~UserDataClient() {} - void setAccessToken(std::string access_token); + void setConfigs(const ClientConfig& clientConfig, const ServerConfig& serverConfig); void setQPS(double QPS); - void setQPSPerCore(double qpsPerCore); + void setQPSPerCore(double QPSPerCore); void setLatencies(double percentileLatency50, double percentileLatency90, double percentileLatency95, double percentileLatency99, double percentileLatency99Point9); @@ -72,17 +68,26 @@ class UserDataClient { void setTimes(double serverSystemTime, double serverUserTime, double clientSystemTime, double clientUserTime); - int sendDataIfReady(); + int sendData(std::string access_token, std::string test_name); - private: +private: std::unique_ptr stub_; - std::string access_token_; - double QPS_; - double percentileLatency50_; - double percentileLatency90_; - double percentileLatency95_; - double percentileLatency99_; - double percentileLatency99Point9_; - bool qpsSet = false; - bool latenciesSet = false; -}; \ No newline at end of file + ClientConfig clientConfig_; + ServerConfig serverConfig_; + double QPS_ = DBL_MIN; + double QPSPerCore_ = DBL_MIN; + double percentileLatency50_ = DBL_MIN; + double percentileLatency90_ = DBL_MIN; + double percentileLatency95_ = DBL_MIN; + double percentileLatency99_ = DBL_MIN; + double percentileLatency99Point9_ = DBL_MIN; + double serverSystemTime_ = DBL_MIN; + double serverUserTime_ = DBL_MIN; + double clientSystemTime_ = DBL_MIN; + double clientUserTime_ = DBL_MIN; +}; + +} //namespace testing +} //namespace grpc + + diff --git a/test/cpp/util/benchmark_config.cc b/test/cpp/util/benchmark_config.cc index b68822436d..6b573abb50 100644 --- a/test/cpp/util/benchmark_config.cc +++ b/test/cpp/util/benchmark_config.cc @@ -39,6 +39,8 @@ DEFINE_bool(enable_log_reporter, true, DEFINE_string(access_token, "", "Authorizing JSON string for leaderboard"); +DEFINE_string(test_name, "", "Name of the test being executed"); + // 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 {} @@ -61,7 +63,7 @@ static std::shared_ptr InitBenchmarkReporters() { } if(!FLAGS_access_token.empty()) composite_reporter->add( - std::unique_ptr(new UserDatabaseReporter("UserDataReporter", FLAGS_access_token))); + std::unique_ptr(new UserDatabaseReporter("UserDataReporter", FLAGS_access_token, FLAGS_test_name))); return std::shared_ptr(composite_reporter); } -- cgit v1.2.3 From f4dafb5654c8cf49a20fe4ec666d3f838dc90fef Mon Sep 17 00:00:00 2001 From: Siddharth Rakesh Date: Wed, 10 Jun 2015 15:10:35 -0700 Subject: updated configs sending --- test/cpp/qps/data_script.sh | 7 +++++++ test/cpp/qps/report.cc | 4 ++-- test/cpp/qps/report.h | 9 +++++---- test/cpp/qps/run_auth_test.py | 6 +++++- test/cpp/qps/user_data.proto | 14 ++++++++------ test/cpp/qps/user_data_client.cc | 20 +++++--------------- test/cpp/qps/user_data_client.h | 2 +- test/cpp/util/benchmark_config.cc | 4 +++- 8 files changed, 36 insertions(+), 30 deletions(-) create mode 100644 test/cpp/qps/data_script.sh mode change 100644 => 100755 test/cpp/qps/run_auth_test.py (limited to 'test/cpp/util/benchmark_config.cc') diff --git a/test/cpp/qps/data_script.sh b/test/cpp/qps/data_script.sh new file mode 100644 index 0000000000..51d840f8d8 --- /dev/null +++ b/test/cpp/qps/data_script.sh @@ -0,0 +1,7 @@ +while [ true ] +do + python run_auth_test.py ../../../bins/opt/async_streaming_ping_pong_test sidrakesh@google.com + python run_auth_test.py ../../../bins/opt/async_unary_ping_pong_test sidrakesh@google.com + python run_auth_test.py ../../../bins/opt/sync_streaming_ping_pong_test sidrakesh@google.com + python run_auth_test.py ../../../bins/opt/sync_unary_ping_pong_test sidrakesh@google.com +done \ No newline at end of file diff --git a/test/cpp/qps/report.cc b/test/cpp/qps/report.cc index 5642ec8d2d..83860ab9ce 100644 --- a/test/cpp/qps/report.cc +++ b/test/cpp/qps/report.cc @@ -175,8 +175,8 @@ void UserDatabaseReporter::ReportTimes(const ScenarioResult& result) const { userDataClient.setConfigs(result.client_config, result.server_config); } -void UserDatabaseReporter::Flush() const { - int userDataState = userDataClient.sendData(access_token_, test_name_); +void UserDatabaseReporter::SendData() const { + int userDataState = userDataClient.sendData(access_token_, test_name_, sys_info_); switch(userDataState) { case 1: diff --git a/test/cpp/qps/report.h b/test/cpp/qps/report.h index ea09c38585..432ed5ddf2 100644 --- a/test/cpp/qps/report.h +++ b/test/cpp/qps/report.h @@ -106,18 +106,19 @@ class GprLogReporter : public Reporter { /** Reporter for client leaderboard. */ class UserDatabaseReporter : public Reporter { public: - UserDatabaseReporter(const string& name, const string& access_token, - const string& test_name) : Reporter(name), access_token_(access_token), test_name_(test_name) {} - ~UserDatabaseReporter() { Flush(); }; + UserDatabaseReporter(const string& name, const string& access_token, const string& test_name, const string& sys_info) + : Reporter(name), access_token_(access_token), test_name_(test_name), sys_info_(sys_info) {} + ~UserDatabaseReporter() { SendData(); }; private: std::string access_token_; std::string test_name_; + std::string sys_info_; void ReportQPS(const ScenarioResult& result) const GRPC_OVERRIDE; void ReportQPSPerCore(const ScenarioResult& result) const GRPC_OVERRIDE; void ReportLatency(const ScenarioResult& result) const GRPC_OVERRIDE; void ReportTimes(const ScenarioResult& result) const GRPC_OVERRIDE; - void Flush() const; + void SendData() const; }; } // namespace testing diff --git a/test/cpp/qps/run_auth_test.py b/test/cpp/qps/run_auth_test.py old mode 100644 new mode 100755 index 3ed2a7c980..75bdab22a4 --- a/test/cpp/qps/run_auth_test.py +++ b/test/cpp/qps/run_auth_test.py @@ -129,7 +129,11 @@ def main(): accessToken = reauthenticate() testName = sys.argv[1].split('/')[-1] - subprocess.call([sys.argv[1], '--access_token='+accessToken, '--test_name='+testName]) + sysInfo = os.popen('lscpu').readlines() + try: + subprocess.call([sys.argv[1], '--access_token='+accessToken, '--test_name='+testName, '--sys_info='+str(sysInfo).strip('[]')]) + except OSError: + print 'Could not execute the test, please check test path' if __name__ == "__main__": main() \ No newline at end of file diff --git a/test/cpp/qps/user_data.proto b/test/cpp/qps/user_data.proto index 27d0049cf0..947ccce60b 100644 --- a/test/cpp/qps/user_data.proto +++ b/test/cpp/qps/user_data.proto @@ -61,9 +61,10 @@ message Metrics { message DataDetails { optional string timestamp = 1; optional string test_name = 2; - optional Metrics metrics = 3; - optional ClientConfig client_config = 4; - optional ServerConfig server_config = 5; + optional string sys_info = 3; + optional Metrics metrics = 4; + optional ClientConfig client_config = 5; + optional ServerConfig server_config = 6; } //User details @@ -91,9 +92,10 @@ message SingleUserDetails { message SingleUserRecordRequest { optional string access_token = 1; optional string test_name = 2; - optional Metrics metrics = 3; - optional ClientConfig client_config = 4; - optional ServerConfig server_config = 5; + optional string sys_info = 3; + optional Metrics metrics = 4; + optional ClientConfig client_config = 5; + optional ServerConfig server_config = 6; } //Reply to request for storing single user's data diff --git a/test/cpp/qps/user_data_client.cc b/test/cpp/qps/user_data_client.cc index 50b74276d2..f56b79ee4a 100644 --- a/test/cpp/qps/user_data_client.cc +++ b/test/cpp/qps/user_data_client.cc @@ -66,11 +66,13 @@ void UserDataClient::setTimes(double serverSystemTime, double serverUserTime, clientUserTime_ = clientUserTime; } -int UserDataClient::sendData(std::string access_token, std::string test_name) { +int UserDataClient::sendData(std::string access_token, std::string test_name, std::string sys_info) { SingleUserRecordRequest singleUserRecordRequest; singleUserRecordRequest.set_access_token(access_token); singleUserRecordRequest.set_test_name(test_name); + singleUserRecordRequest.set_sys_info(sys_info); + *(singleUserRecordRequest.mutable_client_config()) = clientConfig_; *(singleUserRecordRequest.mutable_server_config()) = serverConfig_; @@ -98,17 +100,5 @@ int UserDataClient::sendData(std::string access_token, std::string test_name) { return -1; } } - -// Get current date/time, format is YYYY-MM-DD.HH:mm:ss -const std::string currentDateTime() { - time_t now = time(0); - struct tm tstruct; - char buf[80]; - tstruct = *localtime(&now); - - strftime(buf, sizeof(buf), "%Y/%m/%d, %X", &tstruct); - return buf; -} - -} -} \ No newline at end of file +} //testing +} //grpc \ No newline at end of file diff --git a/test/cpp/qps/user_data_client.h b/test/cpp/qps/user_data_client.h index 0186ec9071..c99b7e9b3a 100644 --- a/test/cpp/qps/user_data_client.h +++ b/test/cpp/qps/user_data_client.h @@ -68,7 +68,7 @@ public: void setTimes(double serverSystemTime, double serverUserTime, double clientSystemTime, double clientUserTime); - int sendData(std::string access_token, std::string test_name); + int sendData(std::string access_token, std::string test_name, std::string sys_info); private: std::unique_ptr stub_; diff --git a/test/cpp/util/benchmark_config.cc b/test/cpp/util/benchmark_config.cc index 6b573abb50..82663b6a01 100644 --- a/test/cpp/util/benchmark_config.cc +++ b/test/cpp/util/benchmark_config.cc @@ -41,6 +41,8 @@ DEFINE_string(access_token, "", "Authorizing JSON string for leaderboard"); DEFINE_string(test_name, "", "Name of the test being executed"); +DEFINE_string(sys_info, "", "System information"); + // 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 {} @@ -63,7 +65,7 @@ static std::shared_ptr InitBenchmarkReporters() { } if(!FLAGS_access_token.empty()) composite_reporter->add( - std::unique_ptr(new UserDatabaseReporter("UserDataReporter", FLAGS_access_token, FLAGS_test_name))); + std::unique_ptr(new UserDatabaseReporter("UserDataReporter", FLAGS_access_token, FLAGS_test_name, FLAGS_sys_info))); return std::shared_ptr(composite_reporter); } -- cgit v1.2.3 From e2902dee317bdab3cca20501032d74ffdd1b6f55 Mon Sep 17 00:00:00 2001 From: Siddharth Rakesh Date: Wed, 17 Jun 2015 15:01:43 -0700 Subject: commented --- test/cpp/qps/report.cc | 1 + test/cpp/qps/run_auth_test.py | 47 +++++++++++++++++++++++++++++++++------ test/cpp/util/benchmark_config.cc | 5 ++++- 3 files changed, 45 insertions(+), 8 deletions(-) (limited to 'test/cpp/util/benchmark_config.cc') diff --git a/test/cpp/qps/report.cc b/test/cpp/qps/report.cc index 91fe9524cb..25cc13156a 100644 --- a/test/cpp/qps/report.cc +++ b/test/cpp/qps/report.cc @@ -139,6 +139,7 @@ void UserDatabaseReporter::ReportQPSPerCore(const ScenarioResult& result) const auto qpsPerCore = qps / result.server_config.threads(); + userDataClient.setQPS(qps); userDataClient.setQPSPerCore(qpsPerCore); userDataClient.setConfigs(result.client_config, result.server_config); } diff --git a/test/cpp/qps/run_auth_test.py b/test/cpp/qps/run_auth_test.py index c327a505b6..39a4a0ae3f 100755 --- a/test/cpp/qps/run_auth_test.py +++ b/test/cpp/qps/run_auth_test.py @@ -59,7 +59,7 @@ def fetchJSON(url, paramDict): try: response = urllib2.urlopen(req) result = response.read() - + except urllib2.HTTPError, error: result = error.read() @@ -71,7 +71,7 @@ def getUserInfo(accessToken): paramDict = {} JSONBody = fetchJSON(url, paramDict) data = json.loads(JSONBody) - + return data # Returns true if stored access token is valid @@ -197,11 +197,44 @@ def findTestPath(test): # Search for test for root, dirnames, filenames in os.walk('../../../'): - for fileName in fnmatch.filter(filenames, '*'+testName): - testPath = os.path.join(root, fileName) + for fileName in fnmatch.filter(filenames, testName): + testPath = os.path.join(root, fileName) return testPath +def getSysInfo(): + # Fetch system information + sysInfo = os.popen('lscpu').readlines() + + NICs = os.popen('ifconfig | cut -c1-8 | sed \'/^\s*$/d\' | sort -u').readlines() + nicAddrs = os.popen('ifconfig | grep -oE "inet addr:([0-9]{1,3}\.){3}[0-9]{1,3}"').readlines() + + nicInfo = [] + + for i in range(0, len(NICs)): + NIC = NICs[i] + NIC = re.sub(r'[^\w]', '', NIC) + + ethtoolProcess = subprocess.Popen(["ethtool",NIC], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + ethtoolResult = ethtoolProcess.communicate()[0] + + ethtoolResultList = ethtoolResult.split('\n\t') + for ethtoolString in ethtoolResultList: + if ethtoolString.startswith('Speed'): + ethtoolString = ethtoolString.split(':')[1] + ethtoolString = ethtoolString.replace('Mb/s',' Mbps') + nicInfo.append(NIC + ' speed: ' + ethtoolString + '\n') + nicInfo.append(NIC + ' inet address: ' + nicAddrs[i].split(':')[1]) + + print 'Obtaining network info....' + tcp_rr_rate = str(os.popen('netperf -t TCP_RR -v 0').readlines()[1]) + print 'Network info obtained' + + nicInfo.append('TCP RR Transmission Rate per sec: ' + tcp_rr_rate + '\n') + sysInfo = sysInfo + nicInfo + + return sysInfo + def main(): # If tokens directory does not exist, creates it if not os.path.exists(ACCESS_TOKENS_DIR): @@ -227,11 +260,11 @@ def main(): testPath = findTestPath(test) # Get path to test testName = testPath.split('/')[-1] # Get test name - # Fetch system information - sysInfo = os.popen('lscpu').readlines() + sysInfo = getSysInfo() + print '\nBeginning test:\n' # Run the test - subprocess.call([testPath, '--access_token='+accessToken, '--test_name='+testName, '--sys_info='+str(sysInfo).strip('[]')]) + subprocess.call([testPath, '--report_metrics_db=true', '--access_token='+accessToken, '--test_name='+testName, '--sys_info='+str(sysInfo).strip('[]')]) except OSError: print 'Could not execute the test, please check test name' diff --git a/test/cpp/util/benchmark_config.cc b/test/cpp/util/benchmark_config.cc index 82663b6a01..250bb7ac8e 100644 --- a/test/cpp/util/benchmark_config.cc +++ b/test/cpp/util/benchmark_config.cc @@ -37,6 +37,8 @@ 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(access_token, "", "Authorizing JSON string for leaderboard"); DEFINE_string(test_name, "", "Name of the test being executed"); @@ -63,9 +65,10 @@ static std::shared_ptr InitBenchmarkReporters() { composite_reporter->add( std::unique_ptr(new GprLogReporter("LogReporter"))); } - if(!FLAGS_access_token.empty()) + if(FLAGS_report_metrics_db) { composite_reporter->add( std::unique_ptr(new UserDatabaseReporter("UserDataReporter", FLAGS_access_token, FLAGS_test_name, FLAGS_sys_info))); + } return std::shared_ptr(composite_reporter); } -- cgit v1.2.3 From cc5857b624a0f99af1cdf9944213673080d0fe52 Mon Sep 17 00:00:00 2001 From: Siddharth Rakesh Date: Thu, 18 Jun 2015 16:45:55 -0700 Subject: Fixed hanging client declaration, server address can be passed now --- Makefile | 46 +++++++------- build.json | 10 ++-- test/cpp/qps/perf_db.proto | 122 ++++++++++++++++++++++++++++++++++++++ test/cpp/qps/perf_db_client.cc | 114 +++++++++++++++++++++++++++++++++++ test/cpp/qps/perf_db_client.h | 101 +++++++++++++++++++++++++++++++ test/cpp/qps/report.cc | 41 +++++++------ test/cpp/qps/report.h | 12 ++-- test/cpp/qps/run_perf_db_test.py | 4 +- test/cpp/qps/user_data.proto | 122 -------------------------------------- test/cpp/qps/user_data_client.cc | 114 ----------------------------------- test/cpp/qps/user_data_client.h | 100 ------------------------------- test/cpp/util/benchmark_config.cc | 4 +- 12 files changed, 399 insertions(+), 391 deletions(-) create mode 100644 test/cpp/qps/perf_db.proto create mode 100644 test/cpp/qps/perf_db_client.cc create mode 100644 test/cpp/qps/perf_db_client.h delete mode 100644 test/cpp/qps/user_data.proto delete mode 100644 test/cpp/qps/user_data_client.cc delete mode 100644 test/cpp/qps/user_data_client.h (limited to 'test/cpp/util/benchmark_config.cc') diff --git a/Makefile b/Makefile index ef7795c290..a3f6803a3c 100644 --- a/Makefile +++ b/Makefile @@ -2502,30 +2502,30 @@ $(GENDIR)/examples/pubsub/pubsub.grpc.pb.cc: examples/pubsub/pubsub.proto $(PROT endif ifeq ($(NO_PROTOC),true) -$(GENDIR)/test/cpp/qps/qpstest.pb.cc: protoc_dep_error -$(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc: protoc_dep_error +$(GENDIR)/test/cpp/qps/perf_db.pb.cc: protoc_dep_error +$(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc: protoc_dep_error else -$(GENDIR)/test/cpp/qps/qpstest.pb.cc: test/cpp/qps/qpstest.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) +$(GENDIR)/test/cpp/qps/perf_db.pb.cc: test/cpp/qps/perf_db.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(E) "[PROTOC] Generating protobuf CC file from $<" $(Q) mkdir -p `dirname $@` $(Q) $(PROTOC) --cpp_out=$(GENDIR) $< -$(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc: test/cpp/qps/qpstest.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) +$(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc: test/cpp/qps/perf_db.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(E) "[GRPC] Generating gRPC's protobuf service CC file from $<" $(Q) mkdir -p `dirname $@` $(Q) $(PROTOC) --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(BINDIR)/$(CONFIG)/grpc_cpp_plugin $< endif ifeq ($(NO_PROTOC),true) -$(GENDIR)/test/cpp/qps/user_data.pb.cc: protoc_dep_error -$(GENDIR)/test/cpp/qps/user_data.grpc.pb.cc: protoc_dep_error +$(GENDIR)/test/cpp/qps/qpstest.pb.cc: protoc_dep_error +$(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc: protoc_dep_error else -$(GENDIR)/test/cpp/qps/user_data.pb.cc: test/cpp/qps/user_data.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) +$(GENDIR)/test/cpp/qps/qpstest.pb.cc: test/cpp/qps/qpstest.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(E) "[PROTOC] Generating protobuf CC file from $<" $(Q) mkdir -p `dirname $@` $(Q) $(PROTOC) --cpp_out=$(GENDIR) $< -$(GENDIR)/test/cpp/qps/user_data.grpc.pb.cc: test/cpp/qps/user_data.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) +$(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc: test/cpp/qps/qpstest.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(E) "[GRPC] Generating gRPC's protobuf service CC file from $<" $(Q) mkdir -p `dirname $@` $(Q) $(PROTOC) --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(BINDIR)/$(CONFIG)/grpc_cpp_plugin $< @@ -3532,9 +3532,9 @@ endif LIBGRPC++_BENCHMARK_CONFIG_SRC = \ $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc \ - $(GENDIR)/test/cpp/qps/user_data.pb.cc $(GENDIR)/test/cpp/qps/user_data.grpc.pb.cc \ + $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc \ + test/cpp/qps/perf_db_client.cc \ test/cpp/qps/report.cc \ - test/cpp/qps/user_data_client.cc \ test/cpp/util/benchmark_config.cc \ @@ -3579,9 +3579,9 @@ ifneq ($(NO_DEPS),true) -include $(LIBGRPC++_BENCHMARK_CONFIG_OBJS:.o=.dep) endif endif -$(OBJDIR)/$(CONFIG)/test/cpp/qps/report.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/user_data.pb.cc $(GENDIR)/test/cpp/qps/user_data.grpc.pb.cc -$(OBJDIR)/$(CONFIG)/test/cpp/qps/user_data_client.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/user_data.pb.cc $(GENDIR)/test/cpp/qps/user_data.grpc.pb.cc -$(OBJDIR)/$(CONFIG)/test/cpp/util/benchmark_config.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/user_data.pb.cc $(GENDIR)/test/cpp/qps/user_data.grpc.pb.cc +$(OBJDIR)/$(CONFIG)/test/cpp/qps/perf_db_client.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc +$(OBJDIR)/$(CONFIG)/test/cpp/qps/report.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc +$(OBJDIR)/$(CONFIG)/test/cpp/util/benchmark_config.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc LIBGRPC++_TEST_CONFIG_SRC = \ @@ -4094,15 +4094,15 @@ $(OBJDIR)/$(CONFIG)/examples/pubsub/subscriber.o: $(GENDIR)/examples/pubsub/labe LIBQPS_SRC = \ $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc \ - $(GENDIR)/test/cpp/qps/user_data.pb.cc $(GENDIR)/test/cpp/qps/user_data.grpc.pb.cc \ + $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc \ test/cpp/qps/client_async.cc \ test/cpp/qps/client_sync.cc \ test/cpp/qps/driver.cc \ + test/cpp/qps/perf_db_client.cc \ test/cpp/qps/qps_worker.cc \ test/cpp/qps/server_async.cc \ test/cpp/qps/server_sync.cc \ test/cpp/qps/timer.cc \ - test/cpp/qps/user_data_client.cc \ LIBQPS_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBQPS_SRC)))) @@ -4146,14 +4146,14 @@ ifneq ($(NO_DEPS),true) -include $(LIBQPS_OBJS:.o=.dep) endif endif -$(OBJDIR)/$(CONFIG)/test/cpp/qps/client_async.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/user_data.pb.cc $(GENDIR)/test/cpp/qps/user_data.grpc.pb.cc -$(OBJDIR)/$(CONFIG)/test/cpp/qps/client_sync.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/user_data.pb.cc $(GENDIR)/test/cpp/qps/user_data.grpc.pb.cc -$(OBJDIR)/$(CONFIG)/test/cpp/qps/driver.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/user_data.pb.cc $(GENDIR)/test/cpp/qps/user_data.grpc.pb.cc -$(OBJDIR)/$(CONFIG)/test/cpp/qps/qps_worker.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/user_data.pb.cc $(GENDIR)/test/cpp/qps/user_data.grpc.pb.cc -$(OBJDIR)/$(CONFIG)/test/cpp/qps/server_async.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/user_data.pb.cc $(GENDIR)/test/cpp/qps/user_data.grpc.pb.cc -$(OBJDIR)/$(CONFIG)/test/cpp/qps/server_sync.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/user_data.pb.cc $(GENDIR)/test/cpp/qps/user_data.grpc.pb.cc -$(OBJDIR)/$(CONFIG)/test/cpp/qps/timer.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/user_data.pb.cc $(GENDIR)/test/cpp/qps/user_data.grpc.pb.cc -$(OBJDIR)/$(CONFIG)/test/cpp/qps/user_data_client.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/user_data.pb.cc $(GENDIR)/test/cpp/qps/user_data.grpc.pb.cc +$(OBJDIR)/$(CONFIG)/test/cpp/qps/client_async.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc +$(OBJDIR)/$(CONFIG)/test/cpp/qps/client_sync.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc +$(OBJDIR)/$(CONFIG)/test/cpp/qps/driver.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc +$(OBJDIR)/$(CONFIG)/test/cpp/qps/perf_db_client.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc +$(OBJDIR)/$(CONFIG)/test/cpp/qps/qps_worker.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc +$(OBJDIR)/$(CONFIG)/test/cpp/qps/server_async.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc +$(OBJDIR)/$(CONFIG)/test/cpp/qps/server_sync.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc +$(OBJDIR)/$(CONFIG)/test/cpp/qps/timer.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc LIBGRPC_CSHARP_EXT_SRC = \ diff --git a/build.json b/build.json index 9342aea035..3c8dd756ca 100644 --- a/build.json +++ b/build.json @@ -541,9 +541,9 @@ "language": "c++", "src": [ "test/cpp/qps/qpstest.proto", - "test/cpp/qps/user_data.proto", + "test/cpp/qps/perf_db.proto", + "test/cpp/qps/perf_db_client.cc", "test/cpp/qps/report.cc", - "test/cpp/qps/user_data_client.cc", "test/cpp/util/benchmark_config.cc" ] }, @@ -714,15 +714,15 @@ ], "src": [ "test/cpp/qps/qpstest.proto", - "test/cpp/qps/user_data.proto", + "test/cpp/qps/perf_db.proto", "test/cpp/qps/client_async.cc", "test/cpp/qps/client_sync.cc", "test/cpp/qps/driver.cc", + "test/cpp/qps/perf_db_client.cc", "test/cpp/qps/qps_worker.cc", "test/cpp/qps/server_async.cc", "test/cpp/qps/server_sync.cc", - "test/cpp/qps/timer.cc", - "test/cpp/qps/user_data_client.cc" + "test/cpp/qps/timer.cc" ], "deps": [ "grpc_test_util", diff --git a/test/cpp/qps/perf_db.proto b/test/cpp/qps/perf_db.proto new file mode 100644 index 0000000000..f4f174937c --- /dev/null +++ b/test/cpp/qps/perf_db.proto @@ -0,0 +1,122 @@ +// Copyright 2015, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto2"; + +import "test/cpp/qps/qpstest.proto"; + +package grpc.testing; + +service PerfDbTransfer { + // Sends client info + rpc RecordSingleClientData (SingleUserRecordRequest) returns (SingleUserRecordReply) {} + + rpc RetrieveSingleUserData (SingleUserRetrieveRequest) returns (SingleUserRetrieveReply) {} + + rpc RetrieveAllUsersData (AllUsersRetrieveRequest) returns (AllUsersRetrieveReply) {} +} + +//Metrics to be stored +message Metrics { + optional double qps = 1; + optional double qps_per_core = 2; + optional double perc_lat_50 = 3; + optional double perc_lat_90 = 4; + optional double perc_lat_95 = 5; + optional double perc_lat_99 = 6; + optional double perc_lat_99_point_9 = 7; + optional double server_system_time = 8; + optional double server_user_time = 9; + optional double client_system_time = 10; + optional double client_user_time = 11; +} + +//Timestamped details +message DataDetails { + optional string timestamp = 1; + optional string test_name = 2; + optional string sys_info = 3; + optional Metrics metrics = 4; + optional ClientConfig client_config = 5; + optional ServerConfig server_config = 6; +} + +//User details +message UserDetails { + optional string id = 1; + optional string email = 2; + optional bool verified_email = 3; + optional string name = 4; + optional string given_name = 5; + optional string family_name = 6; + optional string link = 7; + optional string picture = 8; + optional string gender = 9; + optional string locale = 10; + optional string hd = 11; +} + +//Stored to database +message SingleUserDetails { + repeated DataDetails data_details = 1; + optional UserDetails user_details = 2; +} + +//Request for storing a single user's data +message SingleUserRecordRequest { + optional string access_token = 1; + optional string test_name = 2; + optional string sys_info = 3; + optional Metrics metrics = 4; + optional ClientConfig client_config = 5; + optional ServerConfig server_config = 6; +} + +//Reply to request for storing single user's data +message SingleUserRecordReply { +} + +//Request for retrieving single user's data +message SingleUserRetrieveRequest { + optional string user_id = 1; +} + +//Reply for request to retrieve single user's data +message SingleUserRetrieveReply { + optional SingleUserDetails details = 1; +} + +//Request for retrieving all users' data +message AllUsersRetrieveReply { + repeated SingleUserDetails user_data = 1; +} + +//Reply to request for retrieving all users' data +message AllUsersRetrieveRequest { +} \ No newline at end of file diff --git a/test/cpp/qps/perf_db_client.cc b/test/cpp/qps/perf_db_client.cc new file mode 100644 index 0000000000..6a1fe7e26e --- /dev/null +++ b/test/cpp/qps/perf_db_client.cc @@ -0,0 +1,114 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "perf_db_client.h" + +namespace grpc { +namespace testing { + +//sets the client and server config information +void PerfDbClient::setConfigs(const ClientConfig& clientConfig, const ServerConfig& serverConfig) const { + clientConfig_ = clientConfig; + serverConfig_ = serverConfig; +} + +//sets the QPS +void PerfDbClient::setQPS(double QPS) const { + QPS_ = QPS; +} + +//sets the QPS per core +void PerfDbClient::setQPSPerCore(double QPSPerCore) const { + QPSPerCore_ = QPSPerCore; +} + +//sets the 50th, 90th, 95th, 99th and 99.9th percentile latency +void PerfDbClient::setLatencies(double percentileLatency50, double percentileLatency90, + double percentileLatency95, double percentileLatency99, double percentileLatency99Point9) const { + percentileLatency50_ = percentileLatency50; + percentileLatency90_ = percentileLatency90; + percentileLatency95_ = percentileLatency95; + percentileLatency99_ = percentileLatency99; + percentileLatency99Point9_ = percentileLatency99Point9; +} + +//sets the server and client, user and system times +void PerfDbClient::setTimes(double serverSystemTime, double serverUserTime, + double clientSystemTime, double clientUserTime) const { + serverSystemTime_ = serverSystemTime; + serverUserTime_ = serverUserTime; + clientSystemTime_ = clientSystemTime; + clientUserTime_ = clientUserTime; +} + +//sends the data to the performancew database server +int PerfDbClient::sendData(std::string access_token, std::string test_name, std::string sys_info) const { + //Data record request object + SingleUserRecordRequest singleUserRecordRequest; + + //setting access token, name of the test and the system information + singleUserRecordRequest.set_access_token(access_token); + singleUserRecordRequest.set_test_name(test_name); + singleUserRecordRequest.set_sys_info(sys_info); + + //setting configs + *(singleUserRecordRequest.mutable_client_config()) = clientConfig_; + *(singleUserRecordRequest.mutable_server_config()) = serverConfig_; + + Metrics* metrics = singleUserRecordRequest.mutable_metrics(); + + //setting metrcs in data record request + if(QPS_ != DBL_MIN) metrics->set_qps(QPS_); + if(QPSPerCore_ != DBL_MIN) metrics->set_qps_per_core(QPSPerCore_); + if(percentileLatency50_ != DBL_MIN) metrics->set_perc_lat_50(percentileLatency50_); + if(percentileLatency90_ != DBL_MIN) metrics->set_perc_lat_90(percentileLatency90_); + if(percentileLatency95_ != DBL_MIN) metrics->set_perc_lat_95(percentileLatency95_); + if(percentileLatency99_ != DBL_MIN) metrics->set_perc_lat_99(percentileLatency99_); + if(percentileLatency99Point9_ != DBL_MIN) metrics->set_perc_lat_99_point_9(percentileLatency99Point9_); + if(serverSystemTime_ != DBL_MIN) metrics->set_server_system_time(serverSystemTime_); + if(serverUserTime_ != DBL_MIN) metrics->set_server_user_time(serverUserTime_); + if(clientSystemTime_ != DBL_MIN) metrics->set_client_system_time(clientSystemTime_); + if(clientUserTime_ != DBL_MIN) metrics->set_client_user_time(clientUserTime_); + + SingleUserRecordReply singleUserRecordReply; + ClientContext context; + + Status status = stub_->RecordSingleClientData(&context, singleUserRecordRequest, &singleUserRecordReply); + if (status.ok()) { + return 1; //data sent to database successfully + } else { + return -1; //error in data sending + } +} +} //testing +} //grpc \ No newline at end of file diff --git a/test/cpp/qps/perf_db_client.h b/test/cpp/qps/perf_db_client.h new file mode 100644 index 0000000000..4a63dbf3d2 --- /dev/null +++ b/test/cpp/qps/perf_db_client.h @@ -0,0 +1,101 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include "test/cpp/qps/perf_db.grpc.pb.h" + + +namespace grpc{ +namespace testing { + +//Manages data sending to performance database server +class PerfDbClient { +public: + PerfDbClient() {} + + void init(std::shared_ptr channel) { stub_ = PerfDbTransfer::NewStub(channel); } + + ~PerfDbClient() {} + + //sets the client and server config information + void setConfigs(const ClientConfig& clientConfig, const ServerConfig& serverConfig) const; + + //sets the QPS + void setQPS(double QPS) const; + + //sets the QPS per core + void setQPSPerCore(double QPSPerCore) const; + + //sets the 50th, 90th, 95th, 99th and 99.9th percentile latency + void setLatencies(double percentileLatency50, double percentileLatency90, + double percentileLatency95, double percentileLatency99, double percentileLatency99Point9) const; + + //sets the server and client, user and system times + void setTimes(double serverSystemTime, double serverUserTime, + double clientSystemTime, double clientUserTime) const; + + //sends the data to the performancew database server + int sendData(std::string access_token, std::string test_name, std::string sys_info) const; + +private: + std::unique_ptr stub_; + mutable ClientConfig clientConfig_; + mutable ServerConfig serverConfig_; + mutable double QPS_ = DBL_MIN; + mutable double QPSPerCore_ = DBL_MIN; + mutable double percentileLatency50_ = DBL_MIN; + mutable double percentileLatency90_ = DBL_MIN; + mutable double percentileLatency95_ = DBL_MIN; + mutable double percentileLatency99_ = DBL_MIN; + mutable double percentileLatency99Point9_ = DBL_MIN; + mutable double serverSystemTime_ = DBL_MIN; + mutable double serverUserTime_ = DBL_MIN; + mutable double clientSystemTime_ = DBL_MIN; + mutable double clientUserTime_ = DBL_MIN; +}; + +} //namespace testing +} //namespace grpc + + diff --git a/test/cpp/qps/report.cc b/test/cpp/qps/report.cc index c524327ff0..3d71f76fd2 100644 --- a/test/cpp/qps/report.cc +++ b/test/cpp/qps/report.cc @@ -35,7 +35,6 @@ #include #include "test/cpp/qps/stats.h" -#include "user_data_client.h" namespace grpc { namespace testing { @@ -119,41 +118,41 @@ void GprLogReporter::ReportTimes(const ScenarioResult& result) const { [](ResourceUsage u) { return u.wall_time; })); } -UserDataClient userDataClient(grpc::CreateChannel("localhost:50052", grpc::InsecureCredentials(), - ChannelArguments())); +// perfDbClient perfDbClient(grpc::CreateChannel("localhost:50052", grpc::InsecureCredentials(), +// ChannelArguments())); //Performance database reporter implementation. -void UserDatabaseReporter::ReportQPS(const ScenarioResult& result) const { +void PerfDbReporter::ReportQPS(const ScenarioResult& result) const { auto qps = result.latencies.Count() / average(result.client_resources, [](ResourceUsage u) { return u.wall_time; }); - userDataClient.setQPS(qps); - userDataClient.setConfigs(result.client_config, result.server_config); + perfDbClient.setQPS(qps); + perfDbClient.setConfigs(result.client_config, result.server_config); } -void UserDatabaseReporter::ReportQPSPerCore(const ScenarioResult& result) const { +void PerfDbReporter::ReportQPSPerCore(const ScenarioResult& result) const { auto qps = result.latencies.Count() / average(result.client_resources, [](ResourceUsage u) { return u.wall_time; }); auto qpsPerCore = qps / result.server_config.threads(); - userDataClient.setQPS(qps); - userDataClient.setQPSPerCore(qpsPerCore); - userDataClient.setConfigs(result.client_config, result.server_config); + perfDbClient.setQPS(qps); + perfDbClient.setQPSPerCore(qpsPerCore); + perfDbClient.setConfigs(result.client_config, result.server_config); } -void UserDatabaseReporter::ReportLatency(const ScenarioResult& result) const { - userDataClient.setLatencies(result.latencies.Percentile(50) / 1000, +void PerfDbReporter::ReportLatency(const ScenarioResult& result) const { + perfDbClient.setLatencies(result.latencies.Percentile(50) / 1000, result.latencies.Percentile(90) / 1000, result.latencies.Percentile(95) / 1000, result.latencies.Percentile(99) / 1000, result.latencies.Percentile(99.9) / 1000); - userDataClient.setConfigs(result.client_config, result.server_config); + perfDbClient.setConfigs(result.client_config, result.server_config); } -void UserDatabaseReporter::ReportTimes(const ScenarioResult& result) const { +void PerfDbReporter::ReportTimes(const ScenarioResult& result) const { double serverSystemTime = 100.0 * sum(result.server_resources, [](ResourceUsage u) { return u.system_time; }) / sum(result.server_resources, @@ -171,22 +170,22 @@ void UserDatabaseReporter::ReportTimes(const ScenarioResult& result) const { sum(result.client_resources, [](ResourceUsage u) { return u.wall_time; }); - userDataClient.setTimes(serverSystemTime, serverUserTime, + perfDbClient.setTimes(serverSystemTime, serverUserTime, clientSystemTime, clientUserTime); - userDataClient.setConfigs(result.client_config, result.server_config); + perfDbClient.setConfigs(result.client_config, result.server_config); } -void UserDatabaseReporter::SendData() const { +void PerfDbReporter::SendData() const { //send data to performance database - int userDataState = userDataClient.sendData(access_token_, test_name_, sys_info_); + int dataState = perfDbClient.sendData(access_token_, test_name_, sys_info_); //check state of data sending - switch(userDataState) { + switch(dataState) { case 1: - gpr_log(GPR_INFO, "Data sent to user database successfully"); + gpr_log(GPR_INFO, "Data sent to performance database successfully"); break; case -1: - gpr_log(GPR_INFO, "Data could not be sent to user database"); + gpr_log(GPR_INFO, "Data could not be sent to performance database"); break; } } diff --git a/test/cpp/qps/report.h b/test/cpp/qps/report.h index 432ed5ddf2..afc79ff75f 100644 --- a/test/cpp/qps/report.h +++ b/test/cpp/qps/report.h @@ -41,6 +41,7 @@ #include "test/cpp/qps/driver.h" #include "test/cpp/qps/qpstest.grpc.pb.h" +#include "perf_db_client.h" namespace grpc { namespace testing { @@ -104,13 +105,16 @@ class GprLogReporter : public Reporter { }; /** Reporter for client leaderboard. */ -class UserDatabaseReporter : public Reporter { +class PerfDbReporter : public Reporter { public: - UserDatabaseReporter(const string& name, const string& access_token, const string& test_name, const string& sys_info) - : Reporter(name), access_token_(access_token), test_name_(test_name), sys_info_(sys_info) {} - ~UserDatabaseReporter() { SendData(); }; + PerfDbReporter(const string& name, const string& access_token, const string& test_name, const string& sys_info, const string& server_address) + : Reporter(name), access_token_(access_token), test_name_(test_name), sys_info_(sys_info) { + perfDbClient.init(grpc::CreateChannel(server_address, grpc::InsecureCredentials(), ChannelArguments())); + } + ~PerfDbReporter() { SendData(); }; private: + PerfDbClient perfDbClient; std::string access_token_; std::string test_name_; std::string sys_info_; diff --git a/test/cpp/qps/run_perf_db_test.py b/test/cpp/qps/run_perf_db_test.py index 7f840fa723..34007aa97c 100755 --- a/test/cpp/qps/run_perf_db_test.py +++ b/test/cpp/qps/run_perf_db_test.py @@ -257,6 +257,8 @@ def main(): except Exception, e: print 'Error in authentication' + serverAddress = 'sidrakesh.mtv.google.corp.com:50052' + try: testPath = findTestPath(test) # Get path to test testName = testPath.split('/')[-1] # Get test name @@ -265,7 +267,7 @@ def main(): print '\nBeginning test:\n' # Run the test - subprocess.call([testPath, '--report_metrics_db=true', '--access_token='+accessToken, '--test_name='+testName, '--sys_info='+str(sysInfo).strip('[]')]) + subprocess.call([testPath, '--report_metrics_db=true', '--access_token='+accessToken, '--test_name='+testName, '--sys_info='+str(sysInfo).strip('[]'), '--server_address='+serverAddress]) except OSError: print 'Could not execute the test, please check test name' diff --git a/test/cpp/qps/user_data.proto b/test/cpp/qps/user_data.proto deleted file mode 100644 index 947ccce60b..0000000000 --- a/test/cpp/qps/user_data.proto +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright 2015, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto2"; - -import "test/cpp/qps/qpstest.proto"; - -package grpc.testing; - -service UserDataTransfer { - // Sends client info - rpc RecordSingleClientData (SingleUserRecordRequest) returns (SingleUserRecordReply) {} - - rpc RetrieveSingleUserData (SingleUserRetrieveRequest) returns (SingleUserRetrieveReply) {} - - rpc RetrieveAllUsersData (AllUsersRetrieveRequest) returns (AllUsersRetrieveReply) {} -} - -//Metrics to be stored -message Metrics { - optional double qps = 1; - optional double qps_per_core = 2; - optional double perc_lat_50 = 3; - optional double perc_lat_90 = 4; - optional double perc_lat_95 = 5; - optional double perc_lat_99 = 6; - optional double perc_lat_99_point_9 = 7; - optional double server_system_time = 8; - optional double server_user_time = 9; - optional double client_system_time = 10; - optional double client_user_time = 11; -} - -//Timestamped details -message DataDetails { - optional string timestamp = 1; - optional string test_name = 2; - optional string sys_info = 3; - optional Metrics metrics = 4; - optional ClientConfig client_config = 5; - optional ServerConfig server_config = 6; -} - -//User details -message UserDetails { - optional string id = 1; - optional string email = 2; - optional bool verified_email = 3; - optional string name = 4; - optional string given_name = 5; - optional string family_name = 6; - optional string link = 7; - optional string picture = 8; - optional string gender = 9; - optional string locale = 10; - optional string hd = 11; -} - -//Stored to database -message SingleUserDetails { - repeated DataDetails data_details = 1; - optional UserDetails user_details = 2; -} - -//Request for storing a single user's data -message SingleUserRecordRequest { - optional string access_token = 1; - optional string test_name = 2; - optional string sys_info = 3; - optional Metrics metrics = 4; - optional ClientConfig client_config = 5; - optional ServerConfig server_config = 6; -} - -//Reply to request for storing single user's data -message SingleUserRecordReply { -} - -//Request for retrieving single user's data -message SingleUserRetrieveRequest { - optional string user_id = 1; -} - -//Reply for request to retrieve single user's data -message SingleUserRetrieveReply { - optional SingleUserDetails details = 1; -} - -//Request for retrieving all users' data -message AllUsersRetrieveReply { - repeated SingleUserDetails user_data = 1; -} - -//Reply to request for retrieving all users' data -message AllUsersRetrieveRequest { -} \ No newline at end of file diff --git a/test/cpp/qps/user_data_client.cc b/test/cpp/qps/user_data_client.cc deleted file mode 100644 index a8ced7559d..0000000000 --- a/test/cpp/qps/user_data_client.cc +++ /dev/null @@ -1,114 +0,0 @@ -/* - * - * Copyright 2015, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "user_data_client.h" - -namespace grpc { -namespace testing { - -//sets the client and server config information -void UserDataClient::setConfigs(const ClientConfig& clientConfig, const ServerConfig& serverConfig) { - clientConfig_ = clientConfig; - serverConfig_ = serverConfig; -} - -//sets the QPS -void UserDataClient::setQPS(double QPS) { - QPS_ = QPS; -} - -//sets the QPS per core -void UserDataClient::setQPSPerCore(double QPSPerCore) { - QPSPerCore_ = QPSPerCore; -} - -//sets the 50th, 90th, 95th, 99th and 99.9th percentile latency -void UserDataClient::setLatencies(double percentileLatency50, double percentileLatency90, - double percentileLatency95, double percentileLatency99, double percentileLatency99Point9) { - percentileLatency50_ = percentileLatency50; - percentileLatency90_ = percentileLatency90; - percentileLatency95_ = percentileLatency95; - percentileLatency99_ = percentileLatency99; - percentileLatency99Point9_ = percentileLatency99Point9; -} - -//sets the server and client, user and system times -void UserDataClient::setTimes(double serverSystemTime, double serverUserTime, - double clientSystemTime, double clientUserTime) { - serverSystemTime_ = serverSystemTime; - serverUserTime_ = serverUserTime; - clientSystemTime_ = clientSystemTime; - clientUserTime_ = clientUserTime; -} - -//sends the data to the performancew database server -int UserDataClient::sendData(std::string access_token, std::string test_name, std::string sys_info) { - //Data record request object - SingleUserRecordRequest singleUserRecordRequest; - - //setting access token, name of the test and the system information - singleUserRecordRequest.set_access_token(access_token); - singleUserRecordRequest.set_test_name(test_name); - singleUserRecordRequest.set_sys_info(sys_info); - - //setting configs - *(singleUserRecordRequest.mutable_client_config()) = clientConfig_; - *(singleUserRecordRequest.mutable_server_config()) = serverConfig_; - - Metrics* metrics = singleUserRecordRequest.mutable_metrics(); - - //setting metrcs in data record request - if(QPS_ != DBL_MIN) metrics->set_qps(QPS_); - if(QPSPerCore_ != DBL_MIN) metrics->set_qps_per_core(QPSPerCore_); - if(percentileLatency50_ != DBL_MIN) metrics->set_perc_lat_50(percentileLatency50_); - if(percentileLatency90_ != DBL_MIN) metrics->set_perc_lat_90(percentileLatency90_); - if(percentileLatency95_ != DBL_MIN) metrics->set_perc_lat_95(percentileLatency95_); - if(percentileLatency99_ != DBL_MIN) metrics->set_perc_lat_99(percentileLatency99_); - if(percentileLatency99Point9_ != DBL_MIN) metrics->set_perc_lat_99_point_9(percentileLatency99Point9_); - if(serverSystemTime_ != DBL_MIN) metrics->set_server_system_time(serverSystemTime_); - if(serverUserTime_ != DBL_MIN) metrics->set_server_user_time(serverUserTime_); - if(clientSystemTime_ != DBL_MIN) metrics->set_client_system_time(clientSystemTime_); - if(clientUserTime_ != DBL_MIN) metrics->set_client_user_time(clientUserTime_); - - SingleUserRecordReply singleUserRecordReply; - ClientContext context; - - Status status = stub_->RecordSingleClientData(&context, singleUserRecordRequest, &singleUserRecordReply); - if (status.IsOk()) { - return 1; //data sent to database successfully - } else { - return -1; //error in data sending - } -} -} //testing -} //grpc \ No newline at end of file diff --git a/test/cpp/qps/user_data_client.h b/test/cpp/qps/user_data_client.h deleted file mode 100644 index c2e07ef5cd..0000000000 --- a/test/cpp/qps/user_data_client.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * - * Copyright 2015, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include "test/cpp/qps/user_data.grpc.pb.h" - - -namespace grpc{ -namespace testing { - -//Manages data sending to performance database server -class UserDataClient { -public: - UserDataClient(std::shared_ptr channel) - : stub_(UserDataTransfer::NewStub(channel)) {} - - ~UserDataClient() {} - - //sets the client and server config information - void setConfigs(const ClientConfig& clientConfig, const ServerConfig& serverConfig); - - //sets the QPS - void setQPS(double QPS); - - //sets the QPS per core - void setQPSPerCore(double QPSPerCore); - - //sets the 50th, 90th, 95th, 99th and 99.9th percentile latency - void setLatencies(double percentileLatency50, double percentileLatency90, - double percentileLatency95, double percentileLatency99, double percentileLatency99Point9); - - //sets the server and client, user and system times - void setTimes(double serverSystemTime, double serverUserTime, - double clientSystemTime, double clientUserTime); - - //sends the data to the performancew database server - int sendData(std::string access_token, std::string test_name, std::string sys_info); - -private: - std::unique_ptr stub_; - ClientConfig clientConfig_; - ServerConfig serverConfig_; - double QPS_ = DBL_MIN; - double QPSPerCore_ = DBL_MIN; - double percentileLatency50_ = DBL_MIN; - double percentileLatency90_ = DBL_MIN; - double percentileLatency95_ = DBL_MIN; - double percentileLatency99_ = DBL_MIN; - double percentileLatency99Point9_ = DBL_MIN; - double serverSystemTime_ = DBL_MIN; - double serverUserTime_ = DBL_MIN; - double clientSystemTime_ = DBL_MIN; - double clientUserTime_ = DBL_MIN; -}; - -} //namespace testing -} //namespace grpc - - diff --git a/test/cpp/util/benchmark_config.cc b/test/cpp/util/benchmark_config.cc index 250bb7ac8e..f8cfabd0d6 100644 --- a/test/cpp/util/benchmark_config.cc +++ b/test/cpp/util/benchmark_config.cc @@ -45,6 +45,8 @@ 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"); + // 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 {} @@ -67,7 +69,7 @@ static std::shared_ptr InitBenchmarkReporters() { } if(FLAGS_report_metrics_db) { composite_reporter->add( - std::unique_ptr(new UserDatabaseReporter("UserDataReporter", FLAGS_access_token, FLAGS_test_name, FLAGS_sys_info))); + std::unique_ptr(new PerfDbReporter("PerfDbReporter", FLAGS_access_token, FLAGS_test_name, FLAGS_sys_info, FLAGS_server_address))); } return std::shared_ptr(composite_reporter); -- cgit v1.2.3 From df77c580dc62f17d848f1899e72501d60b098320 Mon Sep 17 00:00:00 2001 From: Siddharth Rakesh Date: Tue, 23 Jun 2015 16:34:18 -0700 Subject: Added support for passing a tag with the test --- test/cpp/qps/perf_db.proto | 14 ++++++++------ test/cpp/qps/perf_db_client.cc | 3 ++- test/cpp/qps/perf_db_client.h | 2 +- test/cpp/qps/report.cc | 2 +- test/cpp/qps/report.h | 6 ++++-- test/cpp/util/benchmark_config.cc | 5 ++++- 6 files changed, 20 insertions(+), 12 deletions(-) (limited to 'test/cpp/util/benchmark_config.cc') diff --git a/test/cpp/qps/perf_db.proto b/test/cpp/qps/perf_db.proto index 50070fda5b..7f4a460812 100644 --- a/test/cpp/qps/perf_db.proto +++ b/test/cpp/qps/perf_db.proto @@ -62,9 +62,10 @@ message DataDetails { string timestamp = 1; string test_name = 2; string sys_info = 3; - Metrics metrics = 4; - ClientConfig client_config = 5; - ServerConfig server_config = 6; + string tag = 4; + Metrics metrics = 5; + ClientConfig client_config = 6; + ServerConfig server_config = 7; } //User details @@ -93,9 +94,10 @@ message SingleUserRecordRequest { string access_token = 1; string test_name = 2; string sys_info = 3; - Metrics metrics = 4; - ClientConfig client_config = 5; - ServerConfig server_config = 6; + string tag = 4; + Metrics metrics = 5; + ClientConfig client_config = 6; + ServerConfig server_config = 7; } //Reply to request for storing single user's data diff --git a/test/cpp/qps/perf_db_client.cc b/test/cpp/qps/perf_db_client.cc index 0905cde11a..c3a170b398 100644 --- a/test/cpp/qps/perf_db_client.cc +++ b/test/cpp/qps/perf_db_client.cc @@ -72,7 +72,7 @@ void PerfDbClient::setTimes(double serverSystemTime, double serverUserTime, } //sends the data to the performancew database server -int PerfDbClient::sendData(std::string access_token, std::string test_name, std::string sys_info) { +int PerfDbClient::sendData(std::string access_token, std::string test_name, std::string sys_info, std::string tag) { //Data record request object SingleUserRecordRequest singleUserRecordRequest; @@ -80,6 +80,7 @@ int PerfDbClient::sendData(std::string access_token, std::string test_name, std: singleUserRecordRequest.set_access_token(access_token); singleUserRecordRequest.set_test_name(test_name); singleUserRecordRequest.set_sys_info(sys_info); + singleUserRecordRequest.set_tag(tag); //setting configs *(singleUserRecordRequest.mutable_client_config()) = this->clientConfig_; diff --git a/test/cpp/qps/perf_db_client.h b/test/cpp/qps/perf_db_client.h index c19442f35e..be4766ab05 100644 --- a/test/cpp/qps/perf_db_client.h +++ b/test/cpp/qps/perf_db_client.h @@ -88,7 +88,7 @@ public: double clientSystemTime, double clientUserTime); //sends the data to the performancew database server - int sendData(std::string access_token, std::string test_name, std::string sys_info); + int sendData(std::string access_token, std::string test_name, std::string sys_info, std::string tag); private: std::unique_ptr stub_; diff --git a/test/cpp/qps/report.cc b/test/cpp/qps/report.cc index 59c0da31fb..7167d4e336 100644 --- a/test/cpp/qps/report.cc +++ b/test/cpp/qps/report.cc @@ -173,7 +173,7 @@ void PerfDbReporter::ReportTimes(const ScenarioResult& result) { void PerfDbReporter::SendData() { //send data to performance database - int dataState = perfDbClient_.sendData(access_token_, test_name_, sys_info_); + int dataState = perfDbClient_.sendData(access_token_, test_name_, sys_info_, tag_); //check state of data sending switch(dataState) { diff --git a/test/cpp/qps/report.h b/test/cpp/qps/report.h index bba26b990c..565590649a 100644 --- a/test/cpp/qps/report.h +++ b/test/cpp/qps/report.h @@ -107,8 +107,9 @@ class GprLogReporter : public Reporter { /** Reporter for performance database tool */ class PerfDbReporter : public Reporter { public: - PerfDbReporter(const string& name, const string& access_token, const string& test_name, const string& sys_info, const string& server_address) - : Reporter(name), access_token_(access_token), test_name_(test_name), sys_info_(sys_info) { + PerfDbReporter(const string& name, const string& access_token, const string& test_name, + const string& sys_info, const string& server_address, const string& tag) + : Reporter(name), access_token_(access_token), test_name_(test_name), sys_info_(sys_info), tag_(tag) { perfDbClient_.init(grpc::CreateChannel(server_address, grpc::InsecureCredentials(), ChannelArguments())); } ~PerfDbReporter() { SendData(); }; @@ -118,6 +119,7 @@ class PerfDbReporter : public Reporter { std::string access_token_; std::string test_name_; std::string sys_info_; + std::string tag_; void ReportQPS(const ScenarioResult& result) GRPC_OVERRIDE; void ReportQPSPerCore(const ScenarioResult& result) GRPC_OVERRIDE; void ReportLatency(const ScenarioResult& result) GRPC_OVERRIDE; diff --git a/test/cpp/util/benchmark_config.cc b/test/cpp/util/benchmark_config.cc index f8cfabd0d6..030cb28c32 100644 --- a/test/cpp/util/benchmark_config.cc +++ b/test/cpp/util/benchmark_config.cc @@ -47,6 +47,8 @@ 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 {} @@ -69,7 +71,8 @@ static std::shared_ptr InitBenchmarkReporters() { } if(FLAGS_report_metrics_db) { composite_reporter->add( - std::unique_ptr(new PerfDbReporter("PerfDbReporter", FLAGS_access_token, FLAGS_test_name, FLAGS_sys_info, FLAGS_server_address))); + std::unique_ptr(new PerfDbReporter("PerfDbReporter", FLAGS_access_token, FLAGS_test_name, + FLAGS_sys_info, FLAGS_server_address, FLAGS_tag))); } return std::shared_ptr(composite_reporter); -- cgit v1.2.3 From fd1a20a667fc2cfdfe2afd8a8d54cb3f5438b5df Mon Sep 17 00:00:00 2001 From: Siddharth Rakesh Date: Tue, 30 Jun 2015 16:38:32 -0700 Subject: Changes introduced for passing hashed user id instead of access token --- test/cpp/qps/perf_db.proto | 2 +- test/cpp/qps/perf_db_client.cc | 6 +++--- test/cpp/qps/perf_db_client.h | 2 +- test/cpp/qps/report.cc | 2 +- test/cpp/qps/report.h | 6 +++--- test/cpp/util/benchmark_config.cc | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) (limited to 'test/cpp/util/benchmark_config.cc') diff --git a/test/cpp/qps/perf_db.proto b/test/cpp/qps/perf_db.proto index 7a550f83c6..60e038406a 100644 --- a/test/cpp/qps/perf_db.proto +++ b/test/cpp/qps/perf_db.proto @@ -57,7 +57,7 @@ message Metrics { // Request for storing a single user's data message SingleUserRecordRequest { - string access_token = 1; + string hashed_id = 1; string test_name = 2; string sys_info = 3; string tag = 4; diff --git a/test/cpp/qps/perf_db_client.cc b/test/cpp/qps/perf_db_client.cc index 5ec87e150c..0996ea2b27 100644 --- a/test/cpp/qps/perf_db_client.cc +++ b/test/cpp/qps/perf_db_client.cc @@ -39,7 +39,7 @@ namespace testing { // sets the client and server config information void PerfDbClient::setConfigs(const ClientConfig& client_config, const ServerConfig& server_config) { - this->client_config_ = client_config; + client_config_ = client_config; this->server_config_ = server_config; } @@ -76,13 +76,13 @@ void PerfDbClient::setTimes(double server_system_time, double server_user_time, } // sends the data to the performance database server -bool PerfDbClient::sendData(std::string access_token, std::string test_name, +bool PerfDbClient::sendData(std::string hashed_id, std::string test_name, std::string sys_info, std::string tag) { // Data record request object SingleUserRecordRequest single_user_record_request; // setting access token, name of the test and the system information - single_user_record_request.set_access_token(access_token); + single_user_record_request.set_hashed_id(hashed_id); single_user_record_request.set_test_name(test_name); single_user_record_request.set_sys_info(sys_info); single_user_record_request.set_tag(tag); diff --git a/test/cpp/qps/perf_db_client.h b/test/cpp/qps/perf_db_client.h index a22426bced..ce7a88bbff 100644 --- a/test/cpp/qps/perf_db_client.h +++ b/test/cpp/qps/perf_db_client.h @@ -91,7 +91,7 @@ class PerfDbClient { double client_system_time, double client_user_time); // sends the data to the performance database server - bool sendData(std::string access_token, std::string test_name, + bool sendData(std::string hashed_id, std::string test_name, std::string sys_info, std::string tag); private: diff --git a/test/cpp/qps/report.cc b/test/cpp/qps/report.cc index da1dea62ae..ff01ec1501 100644 --- a/test/cpp/qps/report.cc +++ b/test/cpp/qps/report.cc @@ -172,7 +172,7 @@ void PerfDbReporter::ReportTimes(const ScenarioResult& result) { void PerfDbReporter::SendData() { // send data to performance database bool data_state = - perf_db_client_.sendData(access_token_, test_name_, sys_info_, tag_); + perf_db_client_.sendData(hashed_id_, test_name_, sys_info_, tag_); // check state of data sending if (data_state) { diff --git a/test/cpp/qps/report.h b/test/cpp/qps/report.h index 88707bea38..aec3cbe80a 100644 --- a/test/cpp/qps/report.h +++ b/test/cpp/qps/report.h @@ -107,11 +107,11 @@ class GprLogReporter : public Reporter { /** Reporter for performance database tool */ class PerfDbReporter : public Reporter { public: - PerfDbReporter(const string& name, const string& access_token, + PerfDbReporter(const string& name, const string& hashed_id, const string& test_name, const string& sys_info, const string& server_address, const string& tag) : Reporter(name), - access_token_(access_token), + hashed_id_(hashed_id), test_name_(test_name), sys_info_(sys_info), tag_(tag) { @@ -122,7 +122,7 @@ class PerfDbReporter : public Reporter { private: PerfDbClient perf_db_client_; - std::string access_token_; + std::string hashed_id_; std::string test_name_; std::string sys_info_; std::string tag_; diff --git a/test/cpp/util/benchmark_config.cc b/test/cpp/util/benchmark_config.cc index 030cb28c32..91fbbf9677 100644 --- a/test/cpp/util/benchmark_config.cc +++ b/test/cpp/util/benchmark_config.cc @@ -39,7 +39,7 @@ DEFINE_bool(enable_log_reporter, true, DEFINE_bool(report_metrics_db, false, "True if metrics to be reported to performance database"); -DEFINE_string(access_token, "", "Authorizing JSON string for leaderboard"); +DEFINE_string(hashed_id, "", "Hash of the user id"); DEFINE_string(test_name, "", "Name of the test being executed"); @@ -71,7 +71,7 @@ static std::shared_ptr InitBenchmarkReporters() { } if(FLAGS_report_metrics_db) { composite_reporter->add( - std::unique_ptr(new PerfDbReporter("PerfDbReporter", FLAGS_access_token, FLAGS_test_name, + std::unique_ptr(new PerfDbReporter("PerfDbReporter", FLAGS_hashed_id, FLAGS_test_name, FLAGS_sys_info, FLAGS_server_address, FLAGS_tag))); } -- cgit v1.2.3