Class LockMetrics
java.lang.Object
org.ek9lang.core.LockMetrics
How much the compiler's one program lock (
SharedThreadContext) is used and waited for - the measure of
what serialises the front end. Process-wide counters: acquisitions, time spent waiting to acquire, and time the
outermost holder held it.
Off unless asked for (-Dek9.lockMetrics=true, or setEnabled(boolean)). SYMBOL_DEFINITION takes
the lock millions of times on a large workspace, and timing every acquisition would distort the run it measures.
When off, the cost is one volatile read per acquisition.
Read as before/after differences around a phase or stage (snapshot()); never reset, so concurrent
readers cannot disturb each other.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordOne reading of the counters. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanTrue when acquisitions are being counted and timed.(package private) static voidrecordAcquisition(long waitNanos) (package private) static voidrecordHold(long holdNanos) static voidsetEnabled(boolean enable) Turn the counting on or off - for tests and tools; the system property sets the starting value.static LockMetrics.Snapshotsnapshot()The counters now.
-
Method Details
-
isEnabled
public static boolean isEnabled()True when acquisitions are being counted and timed. -
setEnabled
public static void setEnabled(boolean enable) Turn the counting on or off - for tests and tools; the system property sets the starting value. -
snapshot
The counters now. -
recordAcquisition
static void recordAcquisition(long waitNanos) -
recordHold
static void recordHold(long holdNanos)
-