Display pool information on the fly as well.
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 45 46 47 48 49 50 51 52 53 54 55 56
diff --git a/main.c b/main.c
index ec925d8..c453e7d 100644
--- a/main.c
+++ b/main.c
@@ -1412,6 +1412,26 @@ static int active_pools(void)
return ret;
}
+static void display_pool_summary(struct pool *pool)
+{
+ double efficiency = 0.0;
+
+ wprintw(logwin, "Pool: %s\n", pool->rpc_url);
+ wprintw(logwin, " Queued work requests: %d\n", pool->getwork_requested);
+ wprintw(logwin, " Share submissions: %d\n", pool->accepted + pool->rejected);
+ wprintw(logwin, " Accepted shares: %d\n", pool->accepted);
+ wprintw(logwin, " Rejected shares: %d\n", pool->rejected);
+ if (pool->accepted || pool->rejected)
+ wprintw(logwin, " Reject ratio: %.1f\n", (double)(pool->rejected * 100) / (double)(pool->accepted + pool->rejected));
+ efficiency = pool->getwork_requested ? pool->accepted * 100.0 / pool->getwork_requested : 0.0;
+ wprintw(logwin, " Efficiency (accepted / queued): %.0f%%\n", efficiency);
+
+ wprintw(logwin, " Discarded work due to new blocks: %d\n", pool->discarded_work);
+ wprintw(logwin, " Stale submissions discarded due to new blocks: %d\n", pool->stale_shares);
+ wprintw(logwin, " Unable to get work from server occasions: %d\n", pool->localgen_occasions);
+ wprintw(logwin, " Submitting work remotely delay occasions: %d\n\n", pool->remotefail_occasions);
+}
+
static void display_pools(void)
{
struct pool *pool;
@@ -1439,7 +1459,7 @@ retry:
if (pool_strategy == POOL_ROTATE)
wprintw(logwin, "Set to rotate every %d minutes\n", opt_rotate_period);
wprintw(logwin, "[A]dd pool [R]emove pool [D]isable pool [E]nable pool\n");
- wprintw(logwin, "[C]hange management strategy [S]witch pool\n");
+ wprintw(logwin, "[C]hange management strategy [S]witch pool [I]nformation\n");
wprintw(logwin, "Or press any other key to continue\n");
wrefresh(logwin);
pthread_mutex_unlock(&curses_lock);
@@ -1504,6 +1524,15 @@ retry:
pool_strategy = selected;
switch_pools(NULL);
goto updated;
+ } else if (!strncasecmp(&input, "i", 1)) {
+ selected = curses_int("Select pool number");
+ if (selected < 0 || selected >= total_pools) {
+ wprintw(logwin, "Invalid selection");
+ goto retry;
+ }
+ pool = pools[selected];
+ display_pool_summary(pool);
+ goto retry;
}
clear_logwin();