Skip to content
Snippets Groups Projects
Commit fd1a20a6 authored by Siddharth Rakesh's avatar Siddharth Rakesh
Browse files

Changes introduced for passing hashed user id instead of access token

parent a6d13f35
No related branches found
No related tags found
No related merge requests found
...@@ -57,7 +57,7 @@ message Metrics { ...@@ -57,7 +57,7 @@ message Metrics {
// Request for storing a single user's data // Request for storing a single user's data
message SingleUserRecordRequest { message SingleUserRecordRequest {
string access_token = 1; string hashed_id = 1;
string test_name = 2; string test_name = 2;
string sys_info = 3; string sys_info = 3;
string tag = 4; string tag = 4;
......
...@@ -39,7 +39,7 @@ namespace testing { ...@@ -39,7 +39,7 @@ namespace testing {
// sets the client and server config information // sets the client and server config information
void PerfDbClient::setConfigs(const ClientConfig& client_config, void PerfDbClient::setConfigs(const ClientConfig& client_config,
const ServerConfig& server_config) { const ServerConfig& server_config) {
this->client_config_ = client_config; client_config_ = client_config;
this->server_config_ = server_config; this->server_config_ = server_config;
} }
...@@ -76,13 +76,13 @@ void PerfDbClient::setTimes(double server_system_time, double server_user_time, ...@@ -76,13 +76,13 @@ void PerfDbClient::setTimes(double server_system_time, double server_user_time,
} }
// sends the data to the performance database server // 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) { std::string sys_info, std::string tag) {
// Data record request object // Data record request object
SingleUserRecordRequest single_user_record_request; SingleUserRecordRequest single_user_record_request;
// setting access token, name of the test and the system information // 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_test_name(test_name);
single_user_record_request.set_sys_info(sys_info); single_user_record_request.set_sys_info(sys_info);
single_user_record_request.set_tag(tag); single_user_record_request.set_tag(tag);
......
...@@ -91,7 +91,7 @@ class PerfDbClient { ...@@ -91,7 +91,7 @@ class PerfDbClient {
double client_system_time, double client_user_time); double client_system_time, double client_user_time);
// sends the data to the performance database server // 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); std::string sys_info, std::string tag);
private: private:
......
...@@ -172,7 +172,7 @@ void PerfDbReporter::ReportTimes(const ScenarioResult& result) { ...@@ -172,7 +172,7 @@ void PerfDbReporter::ReportTimes(const ScenarioResult& result) {
void PerfDbReporter::SendData() { void PerfDbReporter::SendData() {
// send data to performance database // send data to performance database
bool data_state = 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 // check state of data sending
if (data_state) { if (data_state) {
......
...@@ -107,11 +107,11 @@ class GprLogReporter : public Reporter { ...@@ -107,11 +107,11 @@ class GprLogReporter : public Reporter {
/** Reporter for performance database tool */ /** Reporter for performance database tool */
class PerfDbReporter : public Reporter { class PerfDbReporter : public Reporter {
public: 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& test_name, const string& sys_info,
const string& server_address, const string& tag) const string& server_address, const string& tag)
: Reporter(name), : Reporter(name),
access_token_(access_token), hashed_id_(hashed_id),
test_name_(test_name), test_name_(test_name),
sys_info_(sys_info), sys_info_(sys_info),
tag_(tag) { tag_(tag) {
...@@ -122,7 +122,7 @@ class PerfDbReporter : public Reporter { ...@@ -122,7 +122,7 @@ class PerfDbReporter : public Reporter {
private: private:
PerfDbClient perf_db_client_; PerfDbClient perf_db_client_;
std::string access_token_; std::string hashed_id_;
std::string test_name_; std::string test_name_;
std::string sys_info_; std::string sys_info_;
std::string tag_; std::string tag_;
......
...@@ -39,7 +39,7 @@ DEFINE_bool(enable_log_reporter, true, ...@@ -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_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"); DEFINE_string(test_name, "", "Name of the test being executed");
...@@ -71,7 +71,7 @@ static std::shared_ptr<Reporter> InitBenchmarkReporters() { ...@@ -71,7 +71,7 @@ static std::shared_ptr<Reporter> InitBenchmarkReporters() {
} }
if(FLAGS_report_metrics_db) { if(FLAGS_report_metrics_db) {
composite_reporter->add( composite_reporter->add(
std::unique_ptr<Reporter>(new PerfDbReporter("PerfDbReporter", FLAGS_access_token, FLAGS_test_name, std::unique_ptr<Reporter>(new PerfDbReporter("PerfDbReporter", FLAGS_hashed_id, FLAGS_test_name,
FLAGS_sys_info, FLAGS_server_address, FLAGS_tag))); FLAGS_sys_info, FLAGS_server_address, FLAGS_tag)));
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment