From 78cf4351d9130b7ceac5dca700afdf742111941d Mon Sep 17 00:00:00 2001
From: ChaosMarc <ChaosMarc@gmx.de>
Date: Fri, 5 Jan 2018 12:08:12 +0100
Subject: [PATCH] #125: separate hashrate sums for each component

---
 xmrstak/misc/executor.cpp | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/xmrstak/misc/executor.cpp b/xmrstak/misc/executor.cpp
index f0b6e0e..680f045 100644
--- a/xmrstak/misc/executor.cpp
+++ b/xmrstak/misc/executor.cpp
@@ -761,6 +761,7 @@ void executor::hashrate_report(std::string& out)
 			else
 				out.append(1, '\n');
 
+			double fTotalCur[3] = { 0.0, 0.0, 0.0};
 			for (i = 0; i < nthd; i++)
 			{
 				double fHps[3];
@@ -779,6 +780,10 @@ void executor::hashrate_report(std::string& out)
 				fTotal[0] += fHps[0];
 				fTotal[1] += fHps[1];
 				fTotal[2] += fHps[2];
+				
+				fTotalCur[0] += fHps[0];
+				fTotalCur[1] += fHps[1];
+				fTotalCur[2] += fHps[2];
 
 				if((i & 0x1) == 1) //Odd i's
 					out.append("|\n");
@@ -786,21 +791,25 @@ void executor::hashrate_report(std::string& out)
 
 			if((i & 0x1) == 1) //We had odd number of threads
 				out.append("|\n");
-
-			if(nthd != 1)
-				out.append("-----------------------------------------------------\n");
-			else
-				out.append("---------------------------\n");
+			
+			out.append("Totals (").append(name).append("): ");
+			out.append(hps_format(fTotalCur[0], num, sizeof(num)));
+			out.append(hps_format(fTotalCur[1], num, sizeof(num)));
+			out.append(hps_format(fTotalCur[2], num, sizeof(num)));
+			out.append(" H/s\n");
+			
+			out.append("-----------------------------------------------------------------\n");
 		}
 	}
 
-	out.append("Totals:  ");
+	out.append("Totals (ALL):  ");
 	out.append(hps_format(fTotal[0], num, sizeof(num)));
 	out.append(hps_format(fTotal[1], num, sizeof(num)));
 	out.append(hps_format(fTotal[2], num, sizeof(num)));
 	out.append(" H/s\nHighest: ");
 	out.append(hps_format(fHighestHps, num, sizeof(num)));
 	out.append(" H/s\n");
+	out.append("-----------------------------------------------------------------\n");
 }
 
 char* time_format(char* buf, size_t len, std::chrono::system_clock::time_point time)
-- 
GitLab