Browse Source

Move Utility and Best Share to status line

Luke Dashjr 13 years ago
parent
commit
cbaa33a6e8
2 changed files with 20 additions and 24 deletions
  1. 5 5
      README
  2. 15 19
      miner.c

+ 5 - 5
README

@@ -354,7 +354,7 @@ Q quits the application.
 
 
 G gives you something like:
 G gives you something like:
 
 
-GPU 0: [124.2 / 191.3 Mh/s] [A:77  R:33  HW:0  U:1.73/m  WU 1.73/m]
+GPU 0: [124.2 / 191.3 Mh/s] [A:77  R:33  HW:0]
 Temp: 67.0 C
 Temp: 67.0 C
 Fan Speed: 35% (2500 RPM)
 Fan Speed: 35% (2500 RPM)
 Engine Clock: 960 MHz
 Engine Clock: 960 MHz
@@ -387,7 +387,7 @@ dedicated to this program,
 	https://bitcointalk.org/?topic=78192
 	https://bitcointalk.org/?topic=78192
 
 
 The output line shows the following:
 The output line shows the following:
-5s:1713.6 avg:1707.8 u:1710.2 Mh/s | A:729 R:8 S:0 HW:0 U:22.53/m BS:2.71k
+5s:1713.6 avg:1707.8 u:1710.2 Mh/s | A:729 R:8 S:0 HW:0
 
 
 Each column is as follows:
 Each column is as follows:
 5s:  A 5 second exponentially decaying average hash rate
 5s:  A 5 second exponentially decaying average hash rate
@@ -397,8 +397,6 @@ A:   The number of Accepted shares
 R:   The number of Rejected shares
 R:   The number of Rejected shares
 S:   Stale shares discarded (not submitted so don't count as rejects)
 S:   Stale shares discarded (not submitted so don't count as rejects)
 HW:  The number of HardWare errors
 HW:  The number of HardWare errors
-U:   The Utility defined as the number of shares / minute
-BS:  The all time Best Share difficulty you've found
 
 
  GPU 1: 73.5C 2551RPM | 427.3/443.0/442.1Mh/s | A:8 R:0 HW:0 U:4.39/m
  GPU 1: 73.5C 2551RPM | 427.3/443.0/442.1Mh/s | A:8 R:0 HW:0 U:4.39/m
 
 
@@ -414,7 +412,7 @@ The number of hardware erorrs
 The utility defines as the number of shares / minute
 The utility defines as the number of shares / minute
 
 
 The BFGMiner status line shows:
 The BFGMiner status line shows:
- ST: 1  GF: 1  NB: 1  AS: 0  RF: 1  E: 2.42
+ ST: 1  GF: 1  NB: 1  AS: 0  RF: 1  E: 2.42  U:22.53/m  BS:2.71k
 
 
 ST is STaged work items (ready to use).
 ST is STaged work items (ready to use).
 GF is Getwork Fail Occasions (server slow to provide work)
 GF is Getwork Fail Occasions (server slow to provide work)
@@ -423,6 +421,8 @@ AS is Active Submissions (shares in the process of submitting)
 RF is Remote Fail occasions (server slow to accept work)
 RF is Remote Fail occasions (server slow to accept work)
 E  is Efficiency defined as number of shares accepted (multiplied by their
 E  is Efficiency defined as number of shares accepted (multiplied by their
           difficulty) per 2 KB of bandwidth
           difficulty) per 2 KB of bandwidth
+U  is Utility defined as the number of shares / minute
+BS is the all time Best Share difficulty you've found
 
 
 The block display shows:
 The block display shows:
 Block: ...1b89f8d3 #217364  Diff:7.67M (54.93Th/s)  Started: [17:17:22]
 Block: ...1b89f8d3 #217364  Diff:7.67M (54.93Th/s)  Started: [17:17:22]

+ 15 - 19
miner.c

@@ -2284,7 +2284,7 @@ static void adj_width(int var, int *length);
 static void get_statline2(char *buf, struct cgpu_info *cgpu, bool for_curses)
 static void get_statline2(char *buf, struct cgpu_info *cgpu, bool for_curses)
 {
 {
 #ifdef HAVE_CURSES
 #ifdef HAVE_CURSES
-	static int awidth = 1, rwidth = 1, hwwidth = 1, uwidth = 1;
+	static int awidth = 1, rwidth = 1, hwwidth = 1;
 #else
 #else
 	assert(for_curses == false);
 	assert(for_curses == false);
 #endif
 #endif
@@ -2305,7 +2305,6 @@ static void get_statline2(char *buf, struct cgpu_info *cgpu, bool for_curses)
 	int accepted = cgpu->accepted;
 	int accepted = cgpu->accepted;
 	int rejected = cgpu->rejected;
 	int rejected = cgpu->rejected;
 	int hwerrs = cgpu->hw_errors;
 	int hwerrs = cgpu->hw_errors;
-	double util = cgpu->utility;
 	
 	
 	if (!opt_show_procs)
 	if (!opt_show_procs)
 		for (struct cgpu_info *slave = cgpu; (slave = slave->next_proc); )
 		for (struct cgpu_info *slave = cgpu; (slave = slave->next_proc); )
@@ -2319,7 +2318,6 @@ static void get_statline2(char *buf, struct cgpu_info *cgpu, bool for_curses)
 			accepted += slave->accepted;
 			accepted += slave->accepted;
 			rejected += slave->rejected;
 			rejected += slave->rejected;
 			hwerrs += slave->hw_errors;
 			hwerrs += slave->hw_errors;
-			util += slave->utility;
 		}
 		}
 	
 	
 	ti_hashrate_bufstr(
 	ti_hashrate_bufstr(
@@ -2397,27 +2395,24 @@ static void get_statline2(char *buf, struct cgpu_info *cgpu, bool for_curses)
 		adj_width(accepted, &awidth);
 		adj_width(accepted, &awidth);
 		adj_width(rejected, &rwidth);
 		adj_width(rejected, &rwidth);
 		adj_width(hwerrs, &hwwidth);
 		adj_width(hwerrs, &hwwidth);
-		adj_width(util, &uwidth);
 		
 		
-		tailsprintf(buf, "%s/%s/%s | A:%*d R:%*d HW:%*d U:%*.2f/m",
+		tailsprintf(buf, "%s/%s/%s | A:%*d R:%*d HW:%*d",
 		            cHrStatsOpt[cHrStatsI],
 		            cHrStatsOpt[cHrStatsI],
 		            aHr, uHr,
 		            aHr, uHr,
 		            awidth, accepted,
 		            awidth, accepted,
 		            rwidth, rejected,
 		            rwidth, rejected,
-		            hwwidth, hwerrs,
-		            uwidth + 3, util
+		            hwwidth, hwerrs
 		);
 		);
 	}
 	}
 	else
 	else
 #endif
 #endif
 	{
 	{
-		tailsprintf(buf, "%ds:%s avg:%s u:%s | A:%d R:%d HW:%d U:%.1f/m",
+		tailsprintf(buf, "%ds:%s avg:%s u:%s | A:%d R:%d HW:%d",
 			opt_log_interval,
 			opt_log_interval,
 			cHr, aHr, uHr,
 			cHr, aHr, uHr,
 			accepted,
 			accepted,
 			rejected,
 			rejected,
-			hwerrs,
-			util);
+			hwerrs);
 	}
 	}
 	
 	
 	if (drv->get_dev_statline_after || drv->get_statline)
 	if (drv->get_dev_statline_after || drv->get_statline)
@@ -2451,6 +2446,7 @@ static void curses_print_status(void)
 	struct pool *pool = current_pool();
 	struct pool *pool = current_pool();
 	struct timeval now, tv;
 	struct timeval now, tv;
 	float efficiency;
 	float efficiency;
+	double utility;
 
 
 	efficiency = total_bytes_xfer ? total_diff_accepted * 2048. / total_bytes_xfer : 0.0;
 	efficiency = total_bytes_xfer ? total_diff_accepted * 2048. / total_bytes_xfer : 0.0;
 
 
@@ -2479,13 +2475,18 @@ static void curses_print_status(void)
 	mvwhline(statuswin, 1, 0, '-', 80);
 	mvwhline(statuswin, 1, 0, '-', 80);
 	mvwprintw(statuswin, 2, 0, " %s", statusline);
 	mvwprintw(statuswin, 2, 0, " %s", statusline);
 	wclrtoeol(statuswin);
 	wclrtoeol(statuswin);
-	mvwprintw(statuswin, 3, 0, " ST: %d  GF: %d  NB: %d  AS: %d  RF: %d  E: %.2f",
+
+	utility = total_accepted / total_secs * 60;
+
+	mvwprintw(statuswin, 3, 0, " ST: %d  GF: %d  NB: %d  AS: %d  RF: %d  E: %.2f  U:%.1f/m  BS:%s",
 		total_staged(),
 		total_staged(),
 		total_go,
 		total_go,
 		new_blocks,
 		new_blocks,
 		total_submitting,
 		total_submitting,
 		total_ro,
 		total_ro,
-		efficiency);
+		efficiency,
+		utility,
+		best_share);
 	wclrtoeol(statuswin);
 	wclrtoeol(statuswin);
 	if ((pool_strategy == POOL_LOADBALANCE  || pool_strategy == POOL_BALANCE) && total_pools > 1) {
 	if ((pool_strategy == POOL_LOADBALANCE  || pool_strategy == POOL_BALANCE) && total_pools > 1) {
 		mvwprintw(statuswin, 4, 0, " Connected to multiple pools with%s LP",
 		mvwprintw(statuswin, 4, 0, " Connected to multiple pools with%s LP",
@@ -5828,7 +5829,6 @@ static void hashmeter(int thr_id, struct timeval *diff,
 	struct timeval temp_tv_end, total_diff;
 	struct timeval temp_tv_end, total_diff;
 	double secs;
 	double secs;
 	double local_secs;
 	double local_secs;
-	double utility;
 	static double local_mhashes_done = 0;
 	static double local_mhashes_done = 0;
 	static double rolling = 0;
 	static double rolling = 0;
 	double local_mhashes = (double)hashes_done / 1000000.0;
 	double local_mhashes = (double)hashes_done / 1000000.0;
@@ -5910,8 +5910,6 @@ static void hashmeter(int thr_id, struct timeval *diff,
 	total_secs = (double)total_diff.tv_sec +
 	total_secs = (double)total_diff.tv_sec +
 		((double)total_diff.tv_usec / 1000000.0);
 		((double)total_diff.tv_usec / 1000000.0);
 
 
-	utility = total_accepted / total_secs * 60;
-
 	ti_hashrate_bufstr(
 	ti_hashrate_bufstr(
 		(char*[]){cHr, aHr, uHr},
 		(char*[]){cHr, aHr, uHr},
 		1e6*rolling,
 		1e6*rolling,
@@ -5919,15 +5917,13 @@ static void hashmeter(int thr_id, struct timeval *diff,
 		utility_to_hashrate(total_diff_accepted / (total_secs ?: 1) * 60),
 		utility_to_hashrate(total_diff_accepted / (total_secs ?: 1) * 60),
 		H2B_SPACED);
 		H2B_SPACED);
 
 
-	sprintf(statusline, "%s%ds:%s avg:%s u:%s | A:%d R:%d S:%d HW:%d U:%.1f/m BS:%s",
+	sprintf(statusline, "%s%ds:%s avg:%s u:%s | A:%d R:%d S:%d HW:%d",
 		want_per_device_stats ? "ALL " : "",
 		want_per_device_stats ? "ALL " : "",
 		opt_log_interval,
 		opt_log_interval,
 		cHr, aHr,
 		cHr, aHr,
 		uHr,
 		uHr,
 		total_accepted, total_rejected, total_stale,
 		total_accepted, total_rejected, total_stale,
-		hw_errors,
-		utility,
-		best_share);
+		hw_errors);
 
 
 
 
 	local_mhashes_done = 0;
 	local_mhashes_done = 0;