Browse Source

API stats - display pool byte transfer stats

Kano 13 years ago
parent
commit
800ea01658
2 changed files with 7 additions and 0 deletions
  1. 3 0
      API-README
  2. 4 0
      api.c

+ 3 - 0
API-README

@@ -394,6 +394,9 @@ Enforced output limitation:
   however, JSON brackets will be correctly closed and the JSON id will be
   set to 0 (instead of 1) if any data was truncated
 
+Modified API commands:
+ 'stats' - add 'Times Sent', 'Bytes Sent', 'Times Recv', 'Bytes Recv'
+
 ----------
 
 API V1.21 (cgminer v2.10.0)

+ 4 - 0
api.c

@@ -2875,6 +2875,10 @@ static int itemstats(struct io_data *io_data, int i, char *id, struct cgminer_st
 		root = api_add_diff(root, "Max Diff", &(pool_stats->max_diff), false);
 		root = api_add_uint32(root, "Min Diff Count", &(pool_stats->min_diff_count), false);
 		root = api_add_uint32(root, "Max Diff Count", &(pool_stats->max_diff_count), false);
+		root = api_add_uint64(root, "Times Sent", &(pool_stats->times_sent), false);
+		root = api_add_uint64(root, "Bytes Sent", &(pool_stats->bytes_sent), false);
+		root = api_add_uint64(root, "Times Recv", &(pool_stats->times_received), false);
+		root = api_add_uint64(root, "Bytes Recv", &(pool_stats->bytes_received), false);
 	}
 
 	if (extra)