mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 09:12:09 +10:00
sort render stats by total time
This commit is contained in:
@@ -319,12 +319,9 @@ public class DrawingManager {
|
|||||||
// log render time stats periodically
|
// log render time stats periodically
|
||||||
if (System.currentTimeMillis() - lastStatsReportedTime > statReportFrequencyMs) {
|
if (System.currentTimeMillis() - lastStatsReportedTime > statReportFrequencyMs) {
|
||||||
lastStatsReportedTime = System.currentTimeMillis();
|
lastStatsReportedTime = System.currentTimeMillis();
|
||||||
String mapAsString = renderStatsByType.keySet().stream()
|
String mapAsString = renderStatsByType.entrySet().stream().sorted((e1, e2) -> -e1.getValue().getSecond().compareTo(e2.getValue().getSecond()))
|
||||||
.map(k -> {
|
.map(e -> e.getKey() + "=" + e.getValue().getFirst() + "x " +
|
||||||
Pair<Integer, Long> s = renderStatsByType.get(k);
|
TimeUnit.MILLISECONDS.convert( e.getValue().getSecond(), TimeUnit.NANOSECONDS) + "ms ")
|
||||||
return k + "=" + s.getFirst() + "x " +
|
|
||||||
TimeUnit.MILLISECONDS.convert(s.getSecond(), TimeUnit.NANOSECONDS) + "ms ";
|
|
||||||
})
|
|
||||||
.collect(Collectors.joining(", ", "{", "}"));
|
.collect(Collectors.joining(", ", "{", "}"));
|
||||||
LOG.debug("Render stats: " + mapAsString);
|
LOG.debug("Render stats: " + mapAsString);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user