klondike - report mh/s based on nonces found + put old estimate into API stats
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
diff --git a/driver-klondike.c b/driver-klondike.c
index 78f9bec..7ee8e1a 100644
--- a/driver-klondike.c
+++ b/driver-klondike.c
@@ -107,6 +107,8 @@ struct klondike_info {
WORKCFG *cfg;
char *replies;
int nextreply;
+ int noncecount;
+ uint64_t hashcount;
};
IDENTITY KlondikeID;
@@ -316,6 +318,7 @@ static void klondike_check_nonce(struct cgpu_info *klncgpu, WORKRESULT *result)
wr_lock(&(klninfo->stat_lock));
klninfo->devinfo[result->device].noncecount++;
+ klninfo->noncecount++;
wr_unlock(&(klninfo->stat_lock));
result->nonce = le32toh(result->nonce - 0xC0);
@@ -515,7 +518,8 @@ static int64_t klondike_scanwork(struct thr_info *thr)
newhashdev += klninfo->status[dev].maxcount; // hash counter wrapped
newhashdev += klninfo->status[dev].hashcount - klninfo->devinfo[dev].lasthashcount;
klninfo->devinfo[dev].lasthashcount = klninfo->status[dev].hashcount;
- newhashcount += (newhashdev << 32) / klninfo->status[dev].maxcount;
+ klninfo->hashcount += (newhashdev << 32) / klninfo->status[dev].maxcount;
+ newhashcount += 0xffffffffull * (uint64_t)klninfo->noncecount;
// todo: check stats for critical conditions
}
@@ -594,6 +598,9 @@ static struct api_data *klondike_api_stats(struct cgpu_info *klncgpu)
root = api_add_string(root, buf, data, true);
}
}
+
+ root = api_add_uint64(root, "Hash Count", &(klninfo->hashcount), true);
+
rd_unlock(&(klninfo->stat_lock));
return root;