From efd119881a3cf24902b8a073492a5ba57e5f3a83 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Mon, 28 Jun 2004 15:53:06 -0400 Subject: [PATCH] add support to add a string to indicate a particular sample of a run name to make statistical sampling easier. --HG-- extra : convert_revision : b24db4ef747b8ef00a0131db237e97de60c27dc3 --- base/stats/mysql.cc | 14 ++++++++------ base/stats/mysql_run.hh | 7 ++++--- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/base/stats/mysql.cc b/base/stats/mysql.cc index 42f68811b..4c2a60127 100644 --- a/base/stats/mysql.cc +++ b/base/stats/mysql.cc @@ -57,7 +57,8 @@ MySqlConnected() void MySqlRun::connect(const string &host, const string &user, const string &passwd, - const string &db, const string &name, const string &project) + const string &db, const string &name, const string &sample, + const string &project) { if (connected()) panic("can only get one database connection at this time!"); @@ -68,21 +69,22 @@ MySqlRun::connect(const string &host, const string &user, const string &passwd, remove(name); cleanup(); - setup(name, user, project); + setup(name, sample, user, project); } void -MySqlRun::setup(const string &name, const string &user, const string &project) +MySqlRun::setup(const string &name, const string &sample, const string &user, + const string &project) { assert(mysql.connected()); stringstream insert; ccprintf(insert, "INSERT INTO " - "runs(rn_name, rn_user, rn_project, rn_date, rn_expire)" - "values(\"%s\", \"%s\", \"%s\", NOW()," + "runs(rn_name,rn_sample,rn_user,rn_project,rn_date,rn_expire)" + "values(\"%s\", \"%s\", \"%s\", \"%s\", NOW()," "DATE_ADD(CURDATE(), INTERVAL 31 DAY))", - name, user, project); + name, sample, user, project); mysql.query(insert); if (mysql.error) diff --git a/base/stats/mysql_run.hh b/base/stats/mysql_run.hh index 0f8d84297..3e19a184e 100644 --- a/base/stats/mysql_run.hh +++ b/base/stats/mysql_run.hh @@ -46,10 +46,11 @@ struct MySqlRun bool connected() const { return mysql.connected(); } void connect(const std::string &host, const std::string &user, const std::string &passwd, const std::string &db, - const std::string &name, const std::string &project); + const std::string &name, const std::string &sample, + const std::string &project); - void setup(const std::string &name, const std::string &user, - const std::string &project); + void setup(const std::string &name, const std::string &sample, + const std::string &user, const std::string &project); void remove(const std::string &name); void cleanup(); -- 2.30.2