mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-08-23 17:37:25 +00:00
sql/benchs: add new columns to store the plimit and real freqs
also drop the mem amount column, unused and kinda useless...
This commit is contained in:
parent
b425096b8f
commit
81a5552386
2 changed files with 20 additions and 5 deletions
10
sql/2017-02-05-benchmarks.sql
Normal file
10
sql/2017-02-05-benchmarks.sql
Normal file
|
@ -0,0 +1,10 @@
|
|||
-- Recent additions to add after db init (.gz)
|
||||
-- mysql yaamp -p < file.sql
|
||||
|
||||
-- don't forget to restart memcached service to refresh the db structure
|
||||
|
||||
ALTER TABLE `benchmarks` ADD `realfreq` INT(8) UNSIGNED NULL AFTER `freq`;
|
||||
ALTER TABLE `benchmarks` ADD `realmemf` INT(8) UNSIGNED NULL AFTER `memf`;
|
||||
ALTER TABLE `benchmarks` ADD `plimit` INT(5) UNSIGNED NULL AFTER `power`;
|
||||
ALTER TABLE `benchmarks` DROP COLUMN `mem`;
|
||||
|
|
@ -505,7 +505,7 @@ void db_store_stats(YAAMP_DB *db, YAAMP_CLIENT *client, json_value *stats)
|
|||
char sdev[80], stype[8], svid[12], sarch[8];
|
||||
char salgo[32], sclient[48], sdriver[32], sos[8];
|
||||
double khashes, intensity, throughput;
|
||||
int power, mem, freq, memf;
|
||||
int power, freq, memf, realfreq, realmemf, plimit;
|
||||
|
||||
if (!db) return;
|
||||
|
||||
|
@ -524,17 +524,22 @@ void db_store_stats(YAAMP_DB *db, YAAMP_CLIENT *client, json_value *stats)
|
|||
json_str_safe(stats, "driver", sdriver); // or cpu compiler
|
||||
|
||||
power = json_int_safe(stats, "power");
|
||||
mem = json_int_safe(stats, "mem");
|
||||
freq = json_int_safe(stats, "freq");
|
||||
memf = json_int_safe(stats, "memf");
|
||||
realfreq = json_int_safe(stats, "curr_freq");
|
||||
realmemf = json_int_safe(stats, "curr_memf");
|
||||
plimit = json_int_safe(stats, "plimit");
|
||||
intensity = json_double_safe(stats, "intensity");
|
||||
throughput = json_double_safe(stats, "throughput");
|
||||
khashes = json_double_safe(stats, "khashes");
|
||||
|
||||
db_query(db, "INSERT INTO benchmarks("
|
||||
"time, algo, type, device, arch, vendorid, os, driver,"
|
||||
"client, khps, freq, memf, power, mem, intensity, throughput, userid"
|
||||
") VALUES (%d,'%s','%s','%s','%s','%s','%s','%s', '%s',%f,%d,%d,%d,%d,%.2f,%.0f,%d)",
|
||||
"client, khps, freq, memf, realfreq, realmemf, power, plimit, "
|
||||
"intensity, throughput, userid )"
|
||||
"VALUES (%d,'%s','%s','%s','%s','%s','%s','%s',"
|
||||
"'%s',%f,%d,%d,%d,%d,%d,%d, %.2f,%.0f,%d)",
|
||||
t, g_current_algo->name, stype, sdev, sarch, svid, sos, sdriver,
|
||||
sclient, khashes, freq, memf, power, mem, intensity, throughput, client->userid);
|
||||
sclient, khashes, freq, memf, realfreq, realmemf, power, plimit,
|
||||
intensity, throughput, client->userid);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue