Skip to content

Commit ff73dd5

Browse files
committed
Reapply "update metric using timer"
This reverts commit 0623771.
1 parent 0623771 commit ff73dd5

1 file changed

Lines changed: 4 additions & 20 deletions

File tree

src/main/java/com/uid2/operator/Main.java

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,7 @@
6969
public class Main {
7070
private static final Logger LOGGER = LoggerFactory.getLogger(Main.class);
7171

72-
// Startup timing field
7372
private static volatile Instant startupBeginTime;
74-
7573
private final JsonObject config;
7674
private final Vertx vertx;
7775
private final ApplicationVersion appVersion;
@@ -248,25 +246,11 @@ private KeyManager getKeyManager() {
248246
return new KeyManager(this.keysetKeyStore, this.keysetProvider);
249247
}
250248

251-
/**
252-
* Calculate startup duration following established codebase patterns.
253-
* @return Duration from startup begin to completion, or null if timing data is invalid
254-
*/
255-
private static Duration getStartupDuration() {
256-
if (startupBeginTime == null) {
257-
return null;
258-
}
259-
return Duration.between(startupBeginTime, Instant.now());
260-
}
261-
262249
public static void recordStartupComplete() {
263-
final Duration d = getStartupDuration();
264-
if (d == null) return;
265-
Timer
266-
.builder("uid2_operator_startup_duration")
267-
.register(globalRegistry)
268-
.record(d);
269-
LOGGER.info("Operator startup completed in {} seconds", String.format("%.3f", d.toMillis() / 1000.0));
250+
if (startupBeginTime == null) return;
251+
final Duration d = Duration.between(startupBeginTime, Instant.now());
252+
Timer.builder("uid2_operator_startup_duration").register(globalRegistry).record(d);
253+
LOGGER.info("Startup in {} ms", d.toMillis());
270254
}
271255

272256
public static void main(String[] args) throws Exception {

0 commit comments

Comments
 (0)