Browse Source

Split total_bytes_xfer to total_bytes_rcvd and total_bytes_sent

Luke Dashjr 12 years ago
parent
commit
a35a7bb76b
3 changed files with 8 additions and 7 deletions
  1. 2 2
      miner.c
  2. 2 1
      miner.h
  3. 4 4
      util.c

+ 2 - 2
miner.c

@@ -255,7 +255,7 @@ int hw_errors;
 int total_accepted, total_rejected, total_diff1;
 int total_bad_nonces;
 int total_getworks, total_stale, total_discarded;
-uint64_t total_bytes_xfer;
+uint64_t total_bytes_rcvd, total_bytes_sent;
 double total_diff_accepted, total_diff_rejected, total_diff_stale;
 static int staged_rollable;
 unsigned int new_blocks;
@@ -5479,7 +5479,7 @@ void zero_stats(void)
 	hw_errors = 0;
 	total_stale = 0;
 	total_discarded = 0;
-	total_bytes_xfer = 0;
+	total_bytes_rcvd = total_bytes_sent = 0;
 	new_blocks = 0;
 	local_work = 0;
 	total_go = 0;

+ 2 - 1
miner.h

@@ -1008,7 +1008,8 @@ extern unsigned int new_blocks;
 extern unsigned int found_blocks;
 extern int total_accepted, total_rejected, total_diff1;;
 extern int total_getworks, total_stale, total_discarded;
-extern uint64_t total_bytes_xfer;
+extern uint64_t total_bytes_rcvd, total_bytes_sent;
+#define total_bytes_xfer (total_bytes_rcvd + total_bytes_sent)
 extern double total_diff_accepted, total_diff_rejected, total_diff_stale;
 extern unsigned int local_work;
 extern unsigned int total_go, total_ro;

+ 4 - 4
util.c

@@ -339,14 +339,14 @@ static int curl_debug_cb(__maybe_unused CURL *handle, curl_infotype type,
 		case CURLINFO_DATA_IN:
 		case CURLINFO_SSL_DATA_IN:
 			pool->cgminer_pool_stats.bytes_received += size;
-			total_bytes_xfer += size;
+			total_bytes_rcvd += size;
 			pool->cgminer_pool_stats.net_bytes_received += size;
 			break;
 		case CURLINFO_HEADER_OUT:
 		case CURLINFO_DATA_OUT:
 		case CURLINFO_SSL_DATA_OUT:
 			pool->cgminer_pool_stats.bytes_sent += size;
-			total_bytes_xfer += size;
+			total_bytes_sent += size;
 			pool->cgminer_pool_stats.net_bytes_sent += size;
 			break;
 		case CURLINFO_TEXT:
@@ -1366,7 +1366,7 @@ static enum send_ret __stratum_send(struct pool *pool, char *s, ssize_t len)
 
 	pool->cgminer_pool_stats.times_sent++;
 	pool->cgminer_pool_stats.bytes_sent += ssent;
-	total_bytes_xfer += ssent;
+	total_bytes_sent += ssent;
 	pool->cgminer_pool_stats.net_bytes_sent += ssent;
 	return SEND_OK;
 }
@@ -1536,7 +1536,7 @@ char *recv_line(struct pool *pool)
 
 	pool->cgminer_pool_stats.times_received++;
 	pool->cgminer_pool_stats.bytes_received += len;
-	total_bytes_xfer += len;
+	total_bytes_rcvd += len;
 	pool->cgminer_pool_stats.net_bytes_received += len;
 
 out: