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) on PROCESS).
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. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanTrue when acquisitions are being counted and timed.(package private) voidrecordAcquisition(long nanosWaited) (package private) voidrecordHold(long nanosHeld) voidsetEnabled(boolean enable) Turn the counting on or off - for tests and tools; the system property sets the starting value.snapshot()The counters now.
-
Field Details
-
PROCESS
THE lock metrics of this process. The program lock's use is one fact for the run, so this is the one documented process-wide holder (Steve, 2026-10-28, no static methods: the counters stay process-wide, the behaviour is held as an instance): everySharedThreadContextrecords into it and every reader snapshots it.
-
-
Method Details
-
isEnabled
public boolean isEnabled()True when acquisitions are being counted and timed. -
setEnabled
public 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
void recordAcquisition(long nanosWaited) -
recordHold
void recordHold(long nanosHeld)
-