Search in sources :

Example 1 with LockDiagnosticInfo

use of com.palantir.atlasdb.debug.LockDiagnosticInfo in project atlasdb by palantir.

the class LockDiagnosticCollector method logCurrentState.

void logCurrentState() {
    LockDiagnosticInfo lockDiagnosticInfo = computeLockDiagnosticInfo(ImmutableMap.copyOf(cache.asMap()));
    log.info("Got a request to log lock diagnostic information", UnsafeArg.of("info", lockDiagnosticInfo));
}
Also used : LockDiagnosticInfo(com.palantir.atlasdb.debug.LockDiagnosticInfo) ImmutableLockDiagnosticInfo(com.palantir.atlasdb.debug.ImmutableLockDiagnosticInfo)

Example 2 with LockDiagnosticInfo

use of com.palantir.atlasdb.debug.LockDiagnosticInfo in project atlasdb by palantir.

the class LockDiagnosticCollector method getAndLogCurrentState.

LockDiagnosticInfo getAndLogCurrentState(Set<UUID> requestIds) {
    Map<UUID, Optional<LockInfo>> cacheSnapshot = ImmutableMap.copyOf(cache.asMap());
    Map<UUID, Optional<LockInfo>> viewForRequestIds = Maps.toMap(requestIds, requestId -> cacheSnapshot.getOrDefault(requestId, Optional.empty()));
    LockDiagnosticInfo diagnosticInfo = computeLockDiagnosticInfo(viewForRequestIds);
    log.info("Got a request to log lock diagnostic information", UnsafeArg.of("info", diagnosticInfo), SafeArg.of("requestIds", requestIds));
    return diagnosticInfo;
}
Also used : Optional(java.util.Optional) LockDiagnosticInfo(com.palantir.atlasdb.debug.LockDiagnosticInfo) ImmutableLockDiagnosticInfo(com.palantir.atlasdb.debug.ImmutableLockDiagnosticInfo) UUID(java.util.UUID)

Aggregations

ImmutableLockDiagnosticInfo (com.palantir.atlasdb.debug.ImmutableLockDiagnosticInfo)2 LockDiagnosticInfo (com.palantir.atlasdb.debug.LockDiagnosticInfo)2 Optional (java.util.Optional)1 UUID (java.util.UUID)1