Browse Source

ckdb - add 1hr user stats to homepage

master
kanoi 11 years ago
parent
commit
1199419fa1
  1. 6
      src/ckdb.c

6
src/ckdb.c

@ -4034,8 +4034,12 @@ static char *cmd_homepage(char *cmd, char *id, __maybe_unused tv_t *now, __maybe
double_to_buf(DATA_USERSTATS(us_item)->hashrate5m, reply, sizeof(reply)); double_to_buf(DATA_USERSTATS(us_item)->hashrate5m, reply, sizeof(reply));
snprintf(tmp, sizeof(tmp), "u_hashrate5m=%s%c", reply, FLDSEP); snprintf(tmp, sizeof(tmp), "u_hashrate5m=%s%c", reply, FLDSEP);
APPEND_REALLOC(buf, off, len, tmp); APPEND_REALLOC(buf, off, len, tmp);
double_to_buf(DATA_USERSTATS(us_item)->hashrate1hr, reply, sizeof(reply));
snprintf(tmp, sizeof(tmp), "u_hashrate1hr=%s", reply);
APPEND_REALLOC(buf, off, len, tmp);
} else { } else {
snprintf(tmp, sizeof(tmp), "u_hashrate5m=?%c", FLDSEP); snprintf(tmp, sizeof(tmp), "u_hashrate5m=?%cu_hashrate1hr=?", FLDSEP);
APPEND_REALLOC(buf, off, len, tmp); APPEND_REALLOC(buf, off, len, tmp);
} }

Loading…
Cancel
Save