File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
opengrok-web/src/main/java/org/opengrok/web Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -56,12 +56,17 @@ public final class WebappListener
56
56
implements ServletContextListener , ServletRequestListener {
57
57
58
58
private static final Logger LOGGER = LoggerFactory .getLogger (WebappListener .class );
59
+ private Timer startupTimer = Timer .builder ("webapp.startup.latency" ).
60
+ description ("web application startup latency" ).
61
+ register (Metrics .getRegistry ());
59
62
60
63
/**
61
64
* {@inheritDoc}
62
65
*/
63
66
@ Override
64
67
public void contextInitialized (final ServletContextEvent servletContextEvent ) {
68
+ Instant start = Instant .now ();
69
+
65
70
ServletContext context = servletContextEvent .getServletContext ();
66
71
RuntimeEnvironment env = RuntimeEnvironment .getInstance ();
67
72
@@ -97,6 +102,7 @@ public void contextInitialized(final ServletContextEvent servletContextEvent) {
97
102
}
98
103
99
104
env .startExpirationTimer ();
105
+ startupTimer .record (Duration .between (start , Instant .now ()));
100
106
}
101
107
102
108
/**
You can’t perform that action at this time.
0 commit comments