diff --git a/api.c b/api.c index 562eb510..64503963 100644 --- a/api.c +++ b/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)(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_time(root, "Last getwork", &last_getwork, false); mutex_unlock(&hash_lock); diff --git a/miner.h b/miner.h index c8ac8087..37cd38b4 100644 --- a/miner.h +++ b/miner.h @@ -976,6 +976,7 @@ extern int opt_api_port; extern bool opt_api_listen; extern bool opt_api_network; extern bool opt_delaynet; +extern time_t last_getwork; extern bool opt_restart; extern bool opt_worktime; extern int swork_id; diff --git a/sgminer.c b/sgminer.c index 0518ae68..6cd81b24 100644 --- a/sgminer.c +++ b/sgminer.c @@ -95,6 +95,7 @@ int opt_expiry = 28; static const bool opt_time = true; unsigned long long global_hashrate; unsigned long global_quota_gcd = 1; +time_t last_getwork; int nDevs; int opt_dynamic_interval = 7; @@ -5899,6 +5900,7 @@ struct work *get_work(struct thr_info *thr, const int thr_id) wake_gws(); } } + last_getwork = time(NULL); applog(LOG_DEBUG, "Got work from get queue to get work for thread %d", thr_id); work->thr_id = thr_id;