use of com.hazelcast.spi.impl.operationservice.impl.Invocation in project hazelcast by hazelcast.
the class InvocationSamplePlugin method runCurrent.
private void runCurrent(DiagnosticsLogWriter writer, long now) {
writer.startSection("Pending");
int count = 0;
boolean maxPrinted = false;
for (Invocation invocation : invocationRegistry) {
long durationMs = now - invocation.firstInvocationTimeMillis;
String operationDesc = toOperationDesc(invocation.op);
occurrences.add(operationDesc, 1);
if (durationMs < thresholdMillis) {
// short invocation, lets move on to the next
continue;
}
// it is a slow invocation
count++;
if (count < maxCount) {
writer.writeEntry(invocation.toString() + " duration=" + durationMs + " ms");
} else if (!maxPrinted) {
maxPrinted = true;
writer.writeEntry("max number of invocations to print reached.");
}
slowOccurrences.add(operationDesc, 1);
}
writer.endSection();
}
use of com.hazelcast.spi.impl.operationservice.impl.Invocation in project hazelcast by hazelcast.
the class PromoteLiteMemberTest method assertPromotionInvocationStarted.
private void assertPromotionInvocationStarted(HazelcastInstance instance) {
OperationServiceImpl operationService = getNode(instance).getNodeEngine().getOperationService();
InvocationRegistry invocationRegistry = operationService.getInvocationRegistry();
assertTrueEventually(() -> {
for (Map.Entry<Long, Invocation> entry : invocationRegistry.entrySet()) {
if (entry.getValue().op instanceof PromoteLiteMemberOp) {
return;
}
}
fail("Cannot find PromoteLiteMemberOp invocation!");
});
}
Aggregations