public class Microtiming extends Object
Can be used to identify bottlenecks or to analyze system performance to measure the average execution time of different tasks.
Once the microtiming framework is enabled it will be notified by other frameworks as defined tasks are executed.
The execution times are combined and can be queried using
An example might be an SQL query which is executed in a loop to perform a file import. Since the SQL-Query is always the same (in case or a prepared statement) the execution times will be added to an average which will be stored until the next call to Microtiming.getTimings().
|Modifier and Type
|Class and Description
Simple value class which represents a measured timing.
|Modifier and Type
|Method and Description
Returns the timestamp of the last reset
Returns a list of recorded timings.
Checks whether the timing is enabled.
Enables/Disables the timing.
Submits a new timing for the given key.
public static List<Microtiming.Timing> getTimings()
This will only report timings, which changed since the last call of getTimings. Using this approach provides a kind of auto filtering which permits to enable this framework in production systems while still getting reasonable small results.
Microtiming.Timing values recorded which where submitted since the
last call to getTimings()
Adds the average to the "live set" which will be output on the next call to
A convenient way to call this method is to use
category - the category of the recorded timing. This permits grouping a microtimings of the same
key - the key for which the value should be submitted
durationInNanos - the number of nanoseconds used as timing for the given key
public static boolean isEnabled()
public static void setEnabled(boolean enabled)
enabled - determines whether the framework should be enabled or disabled
public static long getLastReset()
Copyright © 2018. All rights reserved.