boolean maybeSample(LockAttempt lockAttempt) {
        final boolean added;
        synchronized (monitor) {
            if (shouldAdd(lockAttempt)) {
                byLockPath.put(lockAttempt.getLockPath(), lockAttempt);
                priorityQueue.add(lockAttempt);
                added = true;
            } else {
                added = false;
            }
        }

        if (added) {
            // Unnecessary to invoke under synchronized, although it means that some samples
            // may be without stack trace (just retry if that happens).
            lockAttempt.fillStackTrace();
        }

        return added;
    }
Priority queue containing all samples.  The head of this queue (peek()/poll())
returns the LockAttempt with the smallest duration.
zkfacade/src/main/java/com/yahoo/vespa/curator/stats/LockAttemptSamples.java