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
Enables the profiling via deferred binding.
|
static class |
Profiler.Node
A hierarchical representation of the time spent running a named block of
code.
|
static interface |
Profiler.ProfilerResultConsumer
Provides access to 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 String |
getRelativeTimeString(double reference)
Returns a string, suitable for output to the user, containing the number
of milliseconds which have elapsed since the given reference 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 recorded 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
falsepublic 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
falsepublic 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 datapublic static String getRelativeTimeString(double reference)
reference - the reference time, as returned by
getRelativeTimeMillis()Copyright © 2000–2021 Vaadin Ltd. All rights reserved.