Display works completed in summary and API data.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
diff --git a/api.c b/api.c
index 5a08e85..3ceaa8e 100644
--- a/api.c
+++ b/api.c
@@ -2546,6 +2546,7 @@ static void poolstatus(struct io_data *io_data, __maybe_unused SOCKETTYPE c, __m
root = api_add_uint(root, "Getworks", &(pool->getwork_requested), false);
root = api_add_int(root, "Accepted", &(pool->accepted), false);
root = api_add_int(root, "Rejected", &(pool->rejected), false);
+ root = api_add_int(root, "Works", &pool->works, false);
root = api_add_uint(root, "Discarded", &(pool->discarded_work), false);
root = api_add_uint(root, "Stale", &(pool->stale_shares), false);
root = api_add_uint(root, "Get Failures", &(pool->getfail_occasions), false);
diff --git a/cgminer.c b/cgminer.c
index 0b10df6..ffd1eeb 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -3909,8 +3909,10 @@ void switch_pools(struct pool *selected)
void discard_work(struct work *work)
{
if (!work->clone && !work->rolls && !work->mined) {
- if (work->pool)
+ if (work->pool) {
work->pool->discarded_work++;
+ work->pool->works--;
+ }
total_discarded++;
applog(LOG_DEBUG, "Discarded work");
} else
@@ -4312,6 +4314,7 @@ static void display_pool_summary(struct pool *pool)
if (!pool_localgen(pool))
wlog(" Efficiency (accepted / queued): %.0f%%\n", efficiency);
+ wlog(" Items worked on: %d\n", pool->works);
wlog(" Discarded work due to new blocks: %d\n", pool->discarded_work);
wlog(" Stale submissions discarded due to new blocks: %d\n", pool->stale_shares);
wlog(" Unable to get work from server occasions: %d\n", pool->getfail_occasions);
@@ -7315,6 +7318,7 @@ void print_summary(void)
if (pool->accepted || pool->rejected)
applog(LOG_WARNING, " Reject ratio: %.1f%%", (double)(pool->rejected * 100) / (double)(pool->accepted + pool->rejected));
+ applog(LOG_WARNING, " Items worked on: %d", pool->works);
applog(LOG_WARNING, " Stale submissions discarded due to new blocks: %d", pool->stale_shares);
applog(LOG_WARNING, " Unable to get work from server occasions: %d", pool->getfail_occasions);
applog(LOG_WARNING, " Submitting work remotely delay occasions: %d\n", pool->remotefail_occasions);