update modello stats

This commit is contained in:
Samuele Locatelli
2023-05-15 09:53:45 +02:00
parent e07d7d8d37
commit 06e8f910d8
+7 -7
View File
@@ -27,20 +27,20 @@ namespace WebDoorCreator.SDK
internal volatile static Dictionary<string, string> RunningThreadStatus = new Dictionary<string, string>();
public static ConcurrentQueue<(string, long, long)> RecordList = new ConcurrentQueue<(string, long, long)>();
public static ConcurrentDictionary<string, CumSumData> ExeCumSum = new ConcurrentDictionary<string, CumSumData>();
public static ConcurrentDictionary<int, CumSumData> ExeCumSum = new ConcurrentDictionary<int, CumSumData>();
public static bool RecordData(string nameRef, long exeTime, long othTime)
public static bool RecordData(int numThread , long exeTime, long othTime)
{
bool fatto = false;
if (ExeCumSum.ContainsKey(nameRef))
if (ExeCumSum.ContainsKey(numThread))
{
ExeCumSum[nameRef].NumRec++;
ExeCumSum[nameRef].ExeTime += exeTime;
ExeCumSum[nameRef].OthTime += othTime;
ExeCumSum[numThread].NumRec++;
ExeCumSum[numThread].ExeTime += exeTime;
ExeCumSum[numThread].OthTime += othTime;
}
else
{
ExeCumSum.TryAdd(nameRef, new CumSumData(1, exeTime, othTime));
ExeCumSum.TryAdd(numThread, new CumSumData(1, exeTime, othTime));
}
return fatto;
}