File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/main/java/org/radarbase/hdfs/util Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -21,15 +21,19 @@ import java.util.concurrent.ConcurrentHashMap
2121import java.util.concurrent.ConcurrentMap
2222import java.util.concurrent.atomic.LongAdder
2323import org.radarbase.hdfs.util.ProgressBar.Companion.appendTime
24+ import java.util.*
2425
2526/* * Timer for multi-threaded timings. The timer may be disabled to increase program performance. */
2627object Timer {
2728 private val shutdownHook = Thread ({ println (Timer ) }, " Timer" )
2829 private val times: ConcurrentMap <String , MutableTimerEntry > = ConcurrentHashMap ()
2930
30- /* * All currently measured timings. This returns a thread-safe snapshot of the current state. */
31+ /* *
32+ * All currently measured timings.
33+ * This returns a thread-safe sorted snapshot of the current state.
34+ */
3135 val timings: Map <String , TimerEntry >
32- get() = times.mapValues { it.value.toTimerEntry() }
36+ get() = times.mapValuesTo( TreeMap ()) { it.value.toTimerEntry() }
3337
3438 /* *
3539 * Whether the timer is enabled. A disabled timer will have much less performance impact on
You can’t perform that action at this time.
0 commit comments