Browse Source

Count remote users and workers in stats.

master
Con Kolivas 8 years ago
parent
commit
30e701e829
  1. 14
      src/stratifier.c

14
src/stratifier.c

@ -825,7 +825,8 @@ static void _ckdbq_add(ckpool_t *ckp, const int idtype, json_t *val, const char
ch = status_chars[(counter++) & 0x3]; ch = status_chars[(counter++) & 0x3];
get_timestamp(stamp); get_timestamp(stamp);
fprintf(stdout, "\33[2K\r%s %c %sH/s %.1f SPS %d users %d workers", fprintf(stdout, "\33[2K\r%s %c %sH/s %.1f SPS %d users %d workers",
stamp, ch, hashrate, stats->sps1, stats->users, stats->workers); stamp, ch, hashrate, stats->sps1, stats->users + stats->remote_users,
stats->workers + stats->remote_workers);
fflush(stdout); fflush(stdout);
} }
} }
@ -4377,7 +4378,8 @@ static void get_poolstats(sdata_t *sdata, int *sockd)
mutex_lock(&sdata->stats_lock); mutex_lock(&sdata->stats_lock);
JSON_CPACK(val, "{si,si,si,si,si,sI,sf,sf,sf,sf,sI,sI,sf,sf,sf,sf,sf,sf,sf}", JSON_CPACK(val, "{si,si,si,si,si,sI,sf,sf,sf,sf,sI,sI,sf,sf,sf,sf,sf,sf,sf}",
"start", stats->start_time.tv_sec, "update", stats->last_update.tv_sec, "start", stats->start_time.tv_sec, "update", stats->last_update.tv_sec,
"workers", stats->workers, "users", stats->users, "disconnected", stats->disconnected, "workers", stats->workers + stats->remote_workers, "users", stats->users + stats->remote_users,
"disconnected", stats->disconnected,
"shares", stats->accounted_shares, "sps1", stats->sps1, "sps5", stats->sps5, "shares", stats->accounted_shares, "sps1", stats->sps1, "sps5", stats->sps5,
"sps15", stats->sps15, "sps60", stats->sps60, "accepted", stats->accounted_diff_shares, "sps15", stats->sps15, "sps60", stats->sps60, "accepted", stats->accounted_diff_shares,
"rejected", stats->accounted_rejects, "dsps1", stats->dsps1, "dsps5", stats->dsps5, "rejected", stats->accounted_rejects, "dsps1", stats->dsps1, "dsps5", stats->dsps5,
@ -8147,8 +8149,8 @@ static void *statsupdate(void *arg)
JSON_CPACK(val, "{si,si,si,si,si,si}", JSON_CPACK(val, "{si,si,si,si,si,si}",
"runtime", diff.tv_sec, "runtime", diff.tv_sec,
"lastupdate", now.tv_sec, "lastupdate", now.tv_sec,
"Users", stats->users, "Users", stats->users + stats->remote_users,
"Workers", stats->workers, "Workers", stats->workers + stats->remote_workers,
"Idle", idle_workers, "Idle", idle_workers,
"Disconnected", stats->disconnected); "Disconnected", stats->disconnected);
s = json_dumps(val, JSON_NO_UTF8 | JSON_PRESERVE_ORDER); s = json_dumps(val, JSON_NO_UTF8 | JSON_PRESERVE_ORDER);
@ -8235,8 +8237,8 @@ static void *statsupdate(void *arg)
JSON_CPACK(val, "{ss,si,si,si,sf,sf,sf,sf,ss,ss,ss,ss}", JSON_CPACK(val, "{ss,si,si,si,sf,sf,sf,sf,ss,ss,ss,ss}",
"poolinstance", ckp->name, "poolinstance", ckp->name,
"elapsed", diff.tv_sec, "elapsed", diff.tv_sec,
"users", stats->users, "users", stats->users + stats->remote_users,
"workers", stats->workers, "workers", stats->workers + stats->remote_workers,
"hashrate", ghs1, "hashrate", ghs1,
"hashrate5m", ghs5, "hashrate5m", ghs5,
"hashrate1hr", ghs60, "hashrate1hr", ghs60,

Loading…
Cancel
Save