Skip to content

Commit acfd5a0

Browse files
committed
Use logger for timings (IFF enabled)
1 parent b34e14c commit acfd5a0

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/main/java/org/radarbase/hdfs/Application.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,10 @@ class Application(override val config: RestructureConfig) : FileStoreFactory {
130130
logger.error("Processing interrupted")
131131
} finally {
132132
// Print timings and reset the timings for the next iteration.
133-
println(Timer)
134-
Timer.reset()
133+
if (Timer.isEnabled) {
134+
logger.info("{}", Timer)
135+
Timer.reset()
136+
}
135137
}
136138
}
137139

src/main/java/org/radarbase/hdfs/util/Timer.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ object Timer {
4444
Runtime.getRuntime().addShutdownHook(shutdownHook)
4545
} else {
4646
Runtime.getRuntime().removeShutdownHook(shutdownHook)
47+
times.clear()
4748
}
4849
}
4950
field = value

0 commit comments

Comments
 (0)