public class Profiler extends Object
<set-property name="vaadin.profiler" value="true" />
to
your .gwt.xml file.Modifier and Type | Class and Description |
---|---|
static class |
Profiler.EnabledProfiler
Class to include using deferred binding to enable the profiling.
|
static class |
Profiler.Node
A hierarchical representation of the time spent running a named block of
code.
|
static interface |
Profiler.ProfilerResultConsumer
Interface for getting data from the
Profiler . |
Constructor and Description |
---|
Profiler() |
Modifier and Type | Method and Description |
---|---|
static void |
enter(String name)
Enters a named block.
|
static double |
getRelativeTimeMillis()
Returns time relative to the particular page load time.
|
static void |
initialize()
Initializes the profiler.
|
static boolean |
isEnabled()
Checks whether the profiling gathering is enabled.
|
protected boolean |
isImplEnabled()
Overridden in
Profiler.EnabledProfiler to make isEnabled() return
true if GWT.create returns that class. |
static void |
leave(String name)
Leaves a named block.
|
static void |
logBootstrapTimings()
Outputs the time passed since various events recored in
performance.timing if supported by the browser.
|
static void |
logTimings()
Outputs the gathered profiling data to the debug console.
|
static void |
reset()
Resets the collected profiler data.
|
static void |
setProfilerResultConsumer(Profiler.ProfilerResultConsumer profilerResultConsumer)
Sets the profiler result consumer that is used to output the profiler
data to the user.
|
public static boolean isEnabled()
true
if the profiling is enabled, else
false
public static void enter(String name)
leave(String)
when leaving the block. Calls to this method will
be removed by the compiler unless profiling is enabled.name
- the name of the entered blockpublic static void leave(String name)
enter(String)
when entering the block. Calls to this method will
be removed by the compiler unless profiling is enabled.name
- the name of the left blockpublic static double getRelativeTimeMillis()
public static void reset()
public static void initialize()
Please note that this method should be called even if the profiler is not enabled because it will then remove a logger function that might have been included in the HTML page and that would leak memory unless removed.
public static void logTimings()
protected boolean isImplEnabled()
Profiler.EnabledProfiler
to make isEnabled()
return
true if GWT.create returns that class.true
if the profiling is enabled, else
false
public static void logBootstrapTimings()
public static void setProfilerResultConsumer(Profiler.ProfilerResultConsumer profilerResultConsumer)
Warning! This is internal API and should not be used by applications or add-ons.
profilerResultConsumer
- the consumer that gets profiler dataCopyright © 2019 Vaadin Ltd. All rights reserved.