java.lang.Object | |
↳ | sun.misc.PerformanceLogger |
This class is intended to be a central place for the jdk to log timing events of interest. There is pre-defined event of startTime, as well as a general mechanism of setting aribtrary times in an array. All unreserved times in the array can be used by callers in application-defined situations. The caller is responsible for setting and getting all times and for doing whatever analysis is interesting; this class is merely a central container for those timing values. Note that, due to the variables in this class being static, use of particular time values by multiple applets will cause confusing results. For example, if plugin runs two applets simultaneously, the initTime for those applets will collide and the results may be undefined.
To automatically track startup performance in an app or applet,
use the command-line parameter sun.perflog as follows:
By default, times are measured using System.currentTimeMillis(). To use
System.nanoTime() instead, add the command-line parameter:
Warning: Use at your own risk!
This class is intended for internal testing
purposes only and may be removed at any time. More
permanent monitoring and profiling APIs are expected to be
developed for future releases and this class will cease to
exist once those APIs are in place.
-Dsun.perflog[=file:
where simply using the parameter with no value will enable output
to the console and a value of "file:
-Dsun.perflog.nano=true
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns message at given index.
| |||||||||||
Gets the start time, which should be the time when
the java process started, prior to the VM actually being
loaded.
| |||||||||||
Returns time at given index.
| |||||||||||
Returns status of whether logging is enabled or not.
| |||||||||||
Outputs all data to parameter-specified Writer object
| |||||||||||
Outputs all data to whatever location the user specified
via sun.perflog command-line parameter.
| |||||||||||
Sets the start time.
| |||||||||||
Sets the start time.
| |||||||||||
Sets the value of a given time and returns the index of the
slot that that time was stored in.
| |||||||||||
Sets the value of a given time and returns the index of the
slot that that time was stored in.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Gets the start time, which should be the time when the java process started, prior to the VM actually being loaded.
Returns time at given index.
Returns status of whether logging is enabled or not. This is provided as a convenience method so that users do not have to perform the same GetPropertyAction check as above to determine whether to enable performance logging.
Outputs all data to whatever location the user specified via sun.perflog command-line parameter.
Sets the start time. This version of the method is given the time to log, instead of expecting this method to get the time itself. This is done in case the time was recorded much earlier than this method was called.
Sets the start time. Ideally, this is the earliest time available during the startup of a Java applet or application. This time is later used to analyze the difference between the initial startup time and other events in the system (such as an applet's init time).
Sets the value of a given time and returns the index of the slot that that time was stored in. This version of the method is given the time to log, instead of expecting this method to get the time itself. This is done in case the time was recorded much earlier than this method was called.
Sets the value of a given time and returns the index of the slot that that time was stored in.