distribution to write raw count

This commit is contained in:
rusefillc 2024-11-09 10:46:57 -05:00 committed by rusefi
parent 819287f896
commit bb010fe90c
1 changed files with 3 additions and 2 deletions

View File

@ -27,11 +27,12 @@ public class PacketRatio {
Writer w = new FileWriter(reportDestinationFolder + File.separator + "distribution_" + simpleFileName + ".txt");
for (Map.Entry<Integer, AtomicInteger> e : countBySID.entrySet()) {
double ratio = 100.0 * e.getValue().get() / logFileContent.size();
int countOfThisSid = e.getValue().get();
double ratio = 100.0 * countOfThisSid / logFileContent.size();
Integer sid = e.getKey();
DbcPacket dbcPacket = dbc == null ? null : dbc.packets.get(sid);
String key = dbcPacket == null ? Integer.toString(sid) : dbcPacket.getName();
w.write(key + ": " + ratio + "\n");
w.write(key + " " + ratio + " " + countOfThisSid + "\n");
}
w.close();
}