Browse Source

Group stale shares in with rejects (but still distinctly counted) and make the percentage be (reject+stale)/total

Luke Dashjr 12 years ago
parent
commit
6e3ed2ea6b
3 changed files with 25 additions and 12 deletions
  1. 5 5
      README
  2. 19 7
      miner.c
  3. 1 0
      miner.h

+ 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( 42%)  HW:0]
+GPU 0: [124.2 / 191.3 Mh/s] [A:77  R:33+0( 42%)  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,18 +387,18 @@ 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(.01%) S:0 HW:0
+ 5s:1713.6 avg:1707.8 u:1710.2 Mh/s | A:729 R:8+0(.01%) 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
 avg: An all time average hash rate
 avg: An all time average hash rate
 u:   An all time average hash rate based on actual accepted shares
 u:   An all time average hash rate based on actual accepted shares
 A:   The number of Accepted shares
 A:   The number of Accepted shares
-R:   The number of Rejected shares (and percentage of total submitted)
-S:   Stale shares discarded (not submitted so don't count as rejects)
+R:   The number of Rejected shares, stale shares discarded (never submitted),
+     and the percentage these are of total found.
 HW:  The number of HardWare errors
 HW:  The number of HardWare errors
 
 
- GPU 1: 73.5C 2551RPM | 427.3/443.0/442.1Mh/s | A:8 R:0(none) HW:0 U:4.39/m
+ GPU 1: 73.5C 2551RPM | 427.3/443.0/442.1Mh/s | A:8 R:0+0(none) HW:0 U:4.39/m
 
 
 Each column is as follows:
 Each column is as follows:
 Temperature (if supported)
 Temperature (if supported)

+ 19 - 7
miner.c

@@ -2302,7 +2302,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;
+	static int awidth = 1, rwidth = 1, swidth = 1, hwwidth = 1;
 #else
 #else
 	assert(for_curses == false);
 	assert(for_curses == false);
 #endif
 #endif
@@ -2323,6 +2323,7 @@ static void get_statline2(char *buf, struct cgpu_info *cgpu, bool for_curses)
 	double wutil = cgpu->utility_diff1;
 	double wutil = cgpu->utility_diff1;
 	int accepted = cgpu->accepted;
 	int accepted = cgpu->accepted;
 	int rejected = cgpu->rejected;
 	int rejected = cgpu->rejected;
+	int stale = cgpu->stale;
 	int hwerrs = cgpu->hw_errors;
 	int hwerrs = cgpu->hw_errors;
 	
 	
 	if (!opt_show_procs)
 	if (!opt_show_procs)
@@ -2336,6 +2337,7 @@ static void get_statline2(char *buf, struct cgpu_info *cgpu, bool for_curses)
 			wutil += slave->utility_diff1;
 			wutil += slave->utility_diff1;
 			accepted += slave->accepted;
 			accepted += slave->accepted;
 			rejected += slave->rejected;
 			rejected += slave->rejected;
+			stale += slave->stale;
 			hwerrs += slave->hw_errors;
 			hwerrs += slave->hw_errors;
 		}
 		}
 	
 	
@@ -2413,26 +2415,29 @@ 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(stale, &swidth);
 		adj_width(hwerrs, &hwwidth);
 		adj_width(hwerrs, &hwwidth);
 		
 		
-		tailsprintf(buf, "%s/%s/%s | A:%*d R:%*d(%s) HW:%*d",
+		tailsprintf(buf, "%s/%s/%s | A:%*d R:%*d+%*d(%s) HW:%*d",
 		            cHrStatsOpt[cHrStatsI],
 		            cHrStatsOpt[cHrStatsI],
 		            aHr, uHr,
 		            aHr, uHr,
 		            awidth, accepted,
 		            awidth, accepted,
 		            rwidth, rejected,
 		            rwidth, rejected,
-		            percentf(rejected, accepted, rejpcbuf),
+		            swidth, stale,
+		            percentf(rejected + stale, accepted, rejpcbuf),
 		            hwwidth, hwerrs
 		            hwwidth, hwerrs
 		);
 		);
 	}
 	}
 	else
 	else
 #endif
 #endif
 	{
 	{
-		tailsprintf(buf, "%ds:%s avg:%s u:%s | A:%d R:%d(%s) HW:%d",
+		tailsprintf(buf, "%ds:%s avg:%s u:%s | A:%d R:%d+%d(%s) HW:%d",
 			opt_log_interval,
 			opt_log_interval,
 			cHr, aHr, uHr,
 			cHr, aHr, uHr,
 			accepted,
 			accepted,
 			rejected,
 			rejected,
-			percentf(rejected, accepted, rejpcbuf),
+			stale,
+			percentf(rejected + stale, accepted, rejpcbuf),
 			hwerrs);
 			hwerrs);
 	}
 	}
 	
 	
@@ -3959,10 +3964,13 @@ static void rebuild_hash(struct work *work)
 
 
 static void submit_discard_share2(const char *reason, struct work *work)
 static void submit_discard_share2(const char *reason, struct work *work)
 {
 {
+	struct cgpu_info *cgpu = get_thr_cgpu(work->thr_id);
+
 	sharelog(reason, work);
 	sharelog(reason, work);
 
 
 	mutex_lock(&stats_lock);
 	mutex_lock(&stats_lock);
 	++total_stale;
 	++total_stale;
+	++cgpu->stale;
 	++(work->pool->stale_shares);
 	++(work->pool->stale_shares);
 	total_diff_stale += work->work_difficulty;
 	total_diff_stale += work->work_difficulty;
 	work->pool->diff_stale += work->work_difficulty;
 	work->pool->diff_stale += work->work_difficulty;
@@ -5307,6 +5315,7 @@ void zero_stats(void)
 		cgpu->total_mhashes = 0;
 		cgpu->total_mhashes = 0;
 		cgpu->accepted = 0;
 		cgpu->accepted = 0;
 		cgpu->rejected = 0;
 		cgpu->rejected = 0;
+		cgpu->stale = 0;
 		cgpu->hw_errors = 0;
 		cgpu->hw_errors = 0;
 		cgpu->utility = 0.0;
 		cgpu->utility = 0.0;
 		cgpu->utility_diff1 = 0;
 		cgpu->utility_diff1 = 0;
@@ -5939,15 +5948,15 @@ 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) S:%d HW:%d",
+	sprintf(statusline, "%s%ds:%s avg:%s u:%s | A:%d R:%d+%d(%s) 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_accepted,
 		total_rejected,
 		total_rejected,
-		percentf(total_rejected, total_accepted, rejpcbuf),
 		total_stale,
 		total_stale,
+		percentf(total_rejected + total_stale, total_accepted, rejpcbuf),
 		hw_errors);
 		hw_errors);
 
 
 
 
@@ -6105,6 +6114,7 @@ void clear_stratum_shares(struct pool *pool)
 {
 {
 	struct stratum_share *sshare, *tmpshare;
 	struct stratum_share *sshare, *tmpshare;
 	struct work *work;
 	struct work *work;
+	struct cgpu_info *cgpu;
 	double diff_cleared = 0;
 	double diff_cleared = 0;
 	int cleared = 0;
 	int cleared = 0;
 
 
@@ -6116,6 +6126,8 @@ void clear_stratum_shares(struct pool *pool)
 			work = sshare->work;
 			work = sshare->work;
 			sharelog("disconnect", work);
 			sharelog("disconnect", work);
 			
 			
+			cgpu = get_thr_cgpu(work->thr_id);
+			++cgpu->stale;
 			diff_cleared += sshare->work->work_difficulty;
 			diff_cleared += sshare->work->work_difficulty;
 			free_work(sshare->work);
 			free_work(sshare->work);
 			free(sshare);
 			free(sshare);

+ 1 - 0
miner.h

@@ -458,6 +458,7 @@ struct cgpu_info {
 	enum dev_enable deven;
 	enum dev_enable deven;
 	int accepted;
 	int accepted;
 	int rejected;
 	int rejected;
+	int stale;
 	int hw_errors;
 	int hw_errors;
 	double rolling;
 	double rolling;
 	double total_mhashes;
 	double total_mhashes;