/
WebAppMetricsListener.java
72 lines (65 loc) · 2.82 KB
/
WebAppMetricsListener.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//
// ========================================================================
// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
// and Apache License v2.0 which accompanies this distribution.
//
// The Eclipse Public License is available at
// http://www.eclipse.org/legal/epl-v10.html
//
// The Apache License v2.0 is available at
// http://www.opensource.org/licenses/apache2.0.php
//
// You may elect to redistribute this code under either of these licenses.
// ========================================================================
//
package org.eclipse.jetty.metrics;
import java.time.Duration;
import javax.servlet.ServletContext;
import org.eclipse.jetty.webapp.Configuration;
import org.eclipse.jetty.webapp.WebAppContext;
public interface WebAppMetricsListener extends ServletMetricsListener
{
enum ConfigurationStep
{
PRE, MAIN, POST
}
/**
* Timing for a specific {@link Configuration} being applied to the {@link WebAppContext}
*
* @param context the specific context that was the configuration was applied to
* @param configuration the configuration that was applied
* @param configurationStep the configuration step
* @param duration the duration for this configuration step
*/
void onWebAppConfigureTiming(WebAppContext context, Configuration configuration, ConfigurationStep configurationStep, Duration duration);
/**
* Event that the WebAppContext has started to be initialized
*
* <p>
* This is similar to {@link #onServletContextStarting(ServletContext)}
* and occurs at a point in time before the ServletContext starts to be initialized.
* The difference in time between this event and {@link #onServletContextStarting(ServletContext)}
* event is due to preconfigure timings for the WebApp itself.
* This often includes things like the Bytecode / Annotation scanning in its overall timing.
* </p>
*
* @param context the specific context that has started to be initialized
* @see #onServletContextStarting(ServletContext)
*/
void onWebAppStarting(WebAppContext context);
/**
* Event that the WebAppContext has completed initialization and is ready to serve requests
*
* <p>
* This is similar to {@link ServletMetricsListener#onServletContextReady(ServletContext)}
* but also includes the postconfigure timings for the WebApp itself.
* </p>
*
* @param context the specific context that was started / initialized
* @see #onServletContextReady(ServletContext)
*/
void onWebAppReady(WebAppContext context);
}