|
|
@ -3497,8 +3497,8 @@ out: |
|
|
|
dec_instance_ref(sdata, client); |
|
|
|
dec_instance_ref(sdata, client); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* Called every 20 seconds, we send the updated stats to ckdb of those users
|
|
|
|
/* Called 32 times per min, we send the updated stats to ckdb of those users
|
|
|
|
* who have gone 10 minutes between updates. This ends up staggering stats to |
|
|
|
* who have gone 1 minute between updates. This ends up staggering stats to |
|
|
|
* avoid floods of stat data coming at once. */ |
|
|
|
* avoid floods of stat data coming at once. */ |
|
|
|
static void update_workerstats(ckpool_t *ckp, sdata_t *sdata) |
|
|
|
static void update_workerstats(ckpool_t *ckp, sdata_t *sdata) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -3815,10 +3815,10 @@ static void *statsupdate(void *arg) |
|
|
|
"createinet", ckp->serverurl[0]); |
|
|
|
"createinet", ckp->serverurl[0]); |
|
|
|
ckdbq_add(ckp, ID_POOLSTATS, val); |
|
|
|
ckdbq_add(ckp, ID_POOLSTATS, val); |
|
|
|
|
|
|
|
|
|
|
|
/* Update stats 3 times per minute for smooth values, displaying
|
|
|
|
/* Update stats 32 times per minute to divide up userstats for
|
|
|
|
* status every minute. */ |
|
|
|
* ckdb, displaying status every minute. */ |
|
|
|
for (i = 0; i < 3; i++) { |
|
|
|
for (i = 0; i < 32; i++) { |
|
|
|
cksleep_ms_r(&stats->last_update, 20000); |
|
|
|
cksleep_ms_r(&stats->last_update, 1875); |
|
|
|
cksleep_prepare_r(&stats->last_update); |
|
|
|
cksleep_prepare_r(&stats->last_update); |
|
|
|
update_workerstats(ckp, sdata); |
|
|
|
update_workerstats(ckp, sdata); |
|
|
|
|
|
|
|
|
|
|
@ -3827,18 +3827,18 @@ static void *statsupdate(void *arg) |
|
|
|
stats->accounted_diff_shares += stats->unaccounted_diff_shares; |
|
|
|
stats->accounted_diff_shares += stats->unaccounted_diff_shares; |
|
|
|
stats->accounted_rejects += stats->unaccounted_rejects; |
|
|
|
stats->accounted_rejects += stats->unaccounted_rejects; |
|
|
|
|
|
|
|
|
|
|
|
decay_time(&stats->sps1, stats->unaccounted_shares, 20, 60); |
|
|
|
decay_time(&stats->sps1, stats->unaccounted_shares, 1.875, 60); |
|
|
|
decay_time(&stats->sps5, stats->unaccounted_shares, 20, 300); |
|
|
|
decay_time(&stats->sps5, stats->unaccounted_shares, 1.875, 300); |
|
|
|
decay_time(&stats->sps15, stats->unaccounted_shares, 20, 900); |
|
|
|
decay_time(&stats->sps15, stats->unaccounted_shares, 1.875, 900); |
|
|
|
decay_time(&stats->sps60, stats->unaccounted_shares, 20, 3600); |
|
|
|
decay_time(&stats->sps60, stats->unaccounted_shares, 1.875, 3600); |
|
|
|
|
|
|
|
|
|
|
|
decay_time(&stats->dsps1, stats->unaccounted_diff_shares, 20, 60); |
|
|
|
decay_time(&stats->dsps1, stats->unaccounted_diff_shares, 1.875, 60); |
|
|
|
decay_time(&stats->dsps5, stats->unaccounted_diff_shares, 20, 300); |
|
|
|
decay_time(&stats->dsps5, stats->unaccounted_diff_shares, 1.875, 300); |
|
|
|
decay_time(&stats->dsps15, stats->unaccounted_diff_shares, 20, 900); |
|
|
|
decay_time(&stats->dsps15, stats->unaccounted_diff_shares, 1.875, 900); |
|
|
|
decay_time(&stats->dsps60, stats->unaccounted_diff_shares, 20, 3600); |
|
|
|
decay_time(&stats->dsps60, stats->unaccounted_diff_shares, 1.875, 3600); |
|
|
|
decay_time(&stats->dsps360, stats->unaccounted_diff_shares, 20, 21600); |
|
|
|
decay_time(&stats->dsps360, stats->unaccounted_diff_shares, 1.875, 21600); |
|
|
|
decay_time(&stats->dsps1440, stats->unaccounted_diff_shares, 20, 86400); |
|
|
|
decay_time(&stats->dsps1440, stats->unaccounted_diff_shares, 1.875, 86400); |
|
|
|
decay_time(&stats->dsps10080, stats->unaccounted_diff_shares, 20, 604800); |
|
|
|
decay_time(&stats->dsps10080, stats->unaccounted_diff_shares, 1.875, 604800); |
|
|
|
|
|
|
|
|
|
|
|
stats->unaccounted_shares = |
|
|
|
stats->unaccounted_shares = |
|
|
|
stats->unaccounted_diff_shares = |
|
|
|
stats->unaccounted_diff_shares = |
|
|
|