Invocation getOrCreate(Integer operationHashCode, Object operation, long lastDurationNanos, long nowNanos, long nowMillis) { Invocation candidate = invocations.get(operationHashCode); if (candidate != null) { return candidate; } int durationMs = (int) TimeUnit.NANOSECONDS.toMillis(lastDurationNanos); long startedAt = nowMillis - durationMs; candidate = new Invocation(operation.toString(), startedAt, nowNanos, durationMs); invocations.put(operationHashCode, candidate); return candidate; }
SlowOperationDTO createDTO() { List<SlowOperationInvocationDTO> invocationDTOList = new ArrayList<SlowOperationInvocationDTO>(invocations.size()); for (Map.Entry<Integer, Invocation> invocationEntry : invocations.entrySet()) { int id = invocationEntry.getKey(); invocationDTOList.add(invocationEntry.getValue().createDTO(id)); } return new SlowOperationDTO(operation, stackTrace, totalInvocations.get(), invocationDTOList); }
operationData.invocation.update(nowNanos, (int) TimeUnit.NANOSECONDS.toMillis(durationNanos)); return;
operationData.invocation.update(nowNanos, (int) TimeUnit.NANOSECONDS.toMillis(durationNanos)); return;
Invocation getOrCreate(Integer operationHashCode, Object operation, long lastDurationNanos, long nowNanos, long nowMillis) { Invocation candidate = invocations.get(operationHashCode); if (candidate != null) { return candidate; } int durationMs = (int) TimeUnit.NANOSECONDS.toMillis(lastDurationNanos); long startedAt = nowMillis - durationMs; candidate = new Invocation(operation.toString(), startedAt, nowNanos, durationMs); invocations.put(operationHashCode, candidate); return candidate; }
SlowOperationDTO createDTO() { List<SlowOperationInvocationDTO> invocationDTOList = new ArrayList<SlowOperationInvocationDTO>(invocations.size()); for (Map.Entry<Integer, Invocation> invocationEntry : invocations.entrySet()) { int id = invocationEntry.getKey(); invocationDTOList.add(invocationEntry.getValue().createDTO(id)); } return new SlowOperationDTO(operation, stackTrace, totalInvocations.get(), invocationDTOList); }