Commit 5ef39032c8a50f77b62646d80f997211d9fa44c5

Kano 2014-01-22T19:04:44

bab add avg fail tests to API stats

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/driver-bab.c b/driver-bab.c
index cb9a25a..37e49eb 100644
--- a/driver-bab.c
+++ b/driver-bab.c
@@ -2271,6 +2271,9 @@ static struct api_data *bab_api_stats(struct cgpu_info *babcgpu)
 
 	root = api_add_uint64(root, "Fail", &(babinfo->fail), true);
 	root = api_add_uint64(root, "Fail Total Tests", &(babinfo->fail_total_tests), true);
+	avg = babinfo->fail ? (float)(babinfo->fail_total_tests) /
+					(float)(babinfo->fail) : 0;
+	root = api_add_avg(root, "Fail Avg Tests", &avg, true);
 	root = api_add_uint64(root, "Fail Work Links", &(babinfo->fail_total_links), true);
 	root = api_add_uint64(root, "Fail Total Work Links", &(babinfo->fail_total_work_links), true);