diff --git a/db/boinc_db.cpp b/db/boinc_db.cpp index e5a6bbaf91..4516f38439 100644 --- a/db/boinc_db.cpp +++ b/db/boinc_db.cpp @@ -316,6 +316,10 @@ void DB_APP_VERSION::db_print(char* buf){ "pfc_n=%.15e, " "pfc_avg=%.15e, " "pfc_scale=%.15e, " + "runtime_n=%.15e, " + "runtime_avg=%.15e, " + "cputime_n=%.15e, " + "cputime_avg=%.15e, " "expavg_credit=%.15e, " "expavg_time=%.15e, " "beta=%d ", @@ -331,6 +335,10 @@ void DB_APP_VERSION::db_print(char* buf){ pfc.n, pfc.avg, pfc_scale, + runtime.n, + runtime.avg, + cputime.n, + cputime.avg, expavg_credit, expavg_time, beta @@ -353,6 +361,10 @@ void DB_APP_VERSION::db_parse(MYSQL_ROW &r) { pfc.n = atof(r[i++]); pfc.avg = atof(r[i++]); pfc_scale = atof(r[i++]); + runtime.n = atof(r[i++]); + runtime.avg = atof(r[i++]); + cputime.n = atof(r[i++]); + cputime.avg = atof(r[i++]); expavg_credit = atof(r[i++]); expavg_time = atof(r[i++]); beta = atoi(r[i++]); @@ -1428,6 +1440,10 @@ int DB_HOST_APP_VERSION::update_validator(DB_HOST_APP_VERSION& orig) { && et.avg == orig.et.avg && et.q == orig.et.q && et.var == orig.et.var + && runtime.n == orig.runtime.n + && runtime.avg == orig.runtime.avg + && cputime.n == orig.cputime.n + && cputime.avg == orig.cputime.avg && turnaround.n == orig.turnaround.n && turnaround.avg == orig.turnaround.avg && turnaround.q == orig.turnaround.q @@ -1444,6 +1460,10 @@ int DB_HOST_APP_VERSION::update_validator(DB_HOST_APP_VERSION& orig) { "et_avg=%.15e, " "et_q=%.15e, " "et_var=%.15e, " + "runtime_n=%.15e, " + "runtime_avg=%.15e, " + "cputime_n=%.15e, " + "cputime_avg=%.15e, " "turnaround_n=%.15e, " "turnaround_avg=%.15e, " "turnaround_q=%.15e, " @@ -1456,6 +1476,10 @@ int DB_HOST_APP_VERSION::update_validator(DB_HOST_APP_VERSION& orig) { et.avg, et.q, et.var, + runtime.n, + runtime.avg, + cputime.n, + cputime.avg, turnaround.n, turnaround.avg, turnaround.q, @@ -1480,6 +1504,10 @@ void DB_HOST_APP_VERSION::db_print(char* buf) { "et_avg=%.15e, " "et_var=%.15e, " "et_q=%.15e, " + "runtime_n=%.15e, " + "runtime_avg=%.15e, " + "cputime_n=%.15e, " + "cputime_avg=%.15e, " "max_jobs_per_day=%d, " "n_jobs_today=%d, " "turnaround_n=%.15e, " @@ -1495,6 +1523,10 @@ void DB_HOST_APP_VERSION::db_print(char* buf) { et.avg, et.var, et.q, + runtime.n, + runtime.avg, + cputime.n, + cputime.avg, max_jobs_per_day, n_jobs_today, turnaround.n, @@ -1516,6 +1548,10 @@ void DB_HOST_APP_VERSION::db_parse(MYSQL_ROW& r) { et.avg = atof(r[i++]); et.var = atof(r[i++]); et.q = atof(r[i++]); + runtime.n = atof(r[i++]); + runtime.avg = atof(r[i++]); + cputime.n = atof(r[i++]); + cputime.avg = atof(r[i++]); max_jobs_per_day = atoi(r[i++]); n_jobs_today = atoi(r[i++]); turnaround.n = atof(r[i++]); diff --git a/db/boinc_db_types.h b/db/boinc_db_types.h index e724f1056c..b548193bd6 100644 --- a/db/boinc_db_types.h +++ b/db/boinc_db_types.h @@ -142,6 +142,8 @@ struct APP_VERSION { // PFC scaling factor for this app (or 0 if not enough data) // The reciprocal of this version's efficiency, averaged over all jobs, // relative to that of the most efficient version + AVERAGE runtime; + AVERAGE cputime; double expavg_credit; double expavg_time; bool beta; @@ -739,6 +741,8 @@ struct HOST_APP_VERSION { // // for old clients (which don't report elapsed time) // we use this for CPU time stats + AVERAGE runtime; + AVERAGE cputime; int max_jobs_per_day; // the actual limit is: // for GPU versions: diff --git a/db/schema.sql b/db/schema.sql index a3d4daea31..47502b5d14 100644 --- a/db/schema.sql +++ b/db/schema.sql @@ -87,6 +87,10 @@ create table app_version ( pfc_n double not null default 0, pfc_avg double not null default 0, pfc_scale double not null default 0, + runtime_n double not null default 0, + runtime_avg double not null default 0, + cputime_n double not null default 0, + cputime_avg double not null default 0, expavg_credit double not null default 0, expavg_time double not null default 0, beta tinyint not null default 0, @@ -229,6 +233,10 @@ create table host_app_version ( et_avg double not null, et_var double not null, et_q double not null, + runtime_n double not null, + runtime_avg double not null, + cputime_n double not null, + cputime_avg double not null, max_jobs_per_day integer not null, n_jobs_today integer not null, turnaround_n double not null, diff --git a/html/ops/db_update.php b/html/ops/db_update.php index 8bf58e9189..594905700a 100644 --- a/html/ops/db_update.php +++ b/html/ops/db_update.php @@ -1230,6 +1230,22 @@ function update_9_12_2018() { "); } +// Add fields needed for computing runtime stats +function update_10_30_2019() { + do_query("alter table app_version + add runtime_n double not null default 0 after pfc_scale, + add runtime_avg double not null default 0 after runtime_n, + add cputime_n double not null default 0 after runtime_avg, + add cputime_avg double not null default 0 after cputime_n + "); + do_query("alter table host_app_version + add runtime_n double not null default 0 after et_q, + add runtime_avg double not null default 0 after runtime_n, + add cputime_n double not null default 0 after runtime_avg, + add cputime_avg double not null default 0 after cputime_n + "); +} + // Updates are done automatically if you use "upgrade". // // If you need to do updates manually, @@ -1289,7 +1305,8 @@ function update_9_12_2018() { array(27025, "update_4_19_2018"), array(27026, "update_5_9_2018"), array(27027, "update_8_23_2018"), - array(27028, "update_9_12_2018") + array(27028, "update_9_12_2018"), + array(27029, "update_10_30_2019") ); ?> diff --git a/html/user/apps.php b/html/user/apps.php index 10d0310932..0b2dd02dc1 100644 --- a/html/user/apps.php +++ b/html/user/apps.php @@ -50,12 +50,14 @@ } else { $b = $app->beta?" (beta test)":""; echo " -