Browse Source

Store when the last getwork was retrieved and display it in the API summary.

nfactor-troky
Con Kolivas 11 years ago committed by Noel Maersk
parent
commit
c31de2601b
  1. 1
      api.c
  2. 1
      miner.h
  3. 2
      sgminer.c

1
api.c

@ -1920,6 +1920,7 @@ static void summary(struct io_data *io_data, __maybe_unused SOCKETTYPE c, __mayb
double stalep = (total_diff_accepted + total_diff_rejected + total_diff_stale) ? double stalep = (total_diff_accepted + total_diff_rejected + total_diff_stale) ?
(double)(total_diff_stale) / (double)(total_diff_accepted + total_diff_rejected + total_diff_stale) : 0; (double)(total_diff_stale) / (double)(total_diff_accepted + total_diff_rejected + total_diff_stale) : 0;
root = api_add_percent(root, "Pool Stale%", &stalep, false); root = api_add_percent(root, "Pool Stale%", &stalep, false);
root = api_add_time(root, "Last getwork", &last_getwork, false);
mutex_unlock(&hash_lock); mutex_unlock(&hash_lock);

1
miner.h

@ -976,6 +976,7 @@ extern int opt_api_port;
extern bool opt_api_listen; extern bool opt_api_listen;
extern bool opt_api_network; extern bool opt_api_network;
extern bool opt_delaynet; extern bool opt_delaynet;
extern time_t last_getwork;
extern bool opt_restart; extern bool opt_restart;
extern bool opt_worktime; extern bool opt_worktime;
extern int swork_id; extern int swork_id;

2
sgminer.c

@ -95,6 +95,7 @@ int opt_expiry = 28;
static const bool opt_time = true; static const bool opt_time = true;
unsigned long long global_hashrate; unsigned long long global_hashrate;
unsigned long global_quota_gcd = 1; unsigned long global_quota_gcd = 1;
time_t last_getwork;
int nDevs; int nDevs;
int opt_dynamic_interval = 7; int opt_dynamic_interval = 7;
@ -5899,6 +5900,7 @@ struct work *get_work(struct thr_info *thr, const int thr_id)
wake_gws(); wake_gws();
} }
} }
last_getwork = time(NULL);
applog(LOG_DEBUG, "Got work from get queue to get work for thread %d", thr_id); applog(LOG_DEBUG, "Got work from get queue to get work for thread %d", thr_id);
work->thr_id = thr_id; work->thr_id = thr_id;

Loading…
Cancel
Save