Skip to content

Commit ba7d88e

Browse files
author
Vladimir Kotal
committed
record correct timer
1 parent e274165 commit ba7d88e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

suggester/src/main/java/org/opengrok/suggest/Suggester.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ public void init(final Collection<NamedIndexDir> luceneIndexes) {
186186
submitInitIfIndexExists(executor, indexDir);
187187
}
188188

189-
shutdownAndAwaitTermination(executor, start, "Suggester successfully initialized");
189+
shutdownAndAwaitTermination(executor, start, suggesterInitTimer,
190+
"Suggester successfully initialized");
190191
initDone.countDown();
191192
}
192193
}
@@ -251,12 +252,13 @@ private boolean indexExists(final Path indexDir) throws IOException {
251252
}
252253

253254
private void shutdownAndAwaitTermination(final ExecutorService executorService, Instant start,
255+
Timer timer,
254256
final String logMessageOnSuccess) {
255257
executorService.shutdown();
256258
try {
257259
executorService.awaitTermination(awaitTerminationTime.toMillis(), TimeUnit.MILLISECONDS);
258260
Duration duration = Duration.between(start, Instant.now());
259-
suggesterInitTimer.record(duration);
261+
timer.record(duration);
260262
logger.log(Level.INFO, "{0} (took {1})", new Object[]{logMessageOnSuccess,
261263
DurationFormatUtils.formatDurationWords(duration.toMillis(),
262264
true, true)});
@@ -296,7 +298,7 @@ public void rebuild(final Collection<NamedIndexDir> indexDirs) {
296298
}
297299
}
298300

299-
shutdownAndAwaitTermination(executor, start,
301+
shutdownAndAwaitTermination(executor, start, suggesterRebuildTimer,
300302
"Suggesters for " + indexDirs + " were successfully rebuilt");
301303
}
302304

0 commit comments

Comments
 (0)