Search in sources :

Example 6 with Invocation

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();
}
Also used : Invocation(com.hazelcast.spi.impl.operationservice.impl.Invocation)

Example 7 with Invocation

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!");
    });
}
Also used : Invocation(com.hazelcast.spi.impl.operationservice.impl.Invocation) PromoteLiteMemberOp(com.hazelcast.internal.cluster.impl.operations.PromoteLiteMemberOp) Map(java.util.Map) IMap(com.hazelcast.map.IMap) OperationServiceImpl(com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl) InvocationRegistry(com.hazelcast.spi.impl.operationservice.impl.InvocationRegistry)

Aggregations

Invocation (com.hazelcast.spi.impl.operationservice.impl.Invocation)7 RaftInvocation (com.hazelcast.spi.impl.operationservice.impl.RaftInvocation)4 Operation (com.hazelcast.spi.impl.operationservice.Operation)3 ChangeRaftGroupMembershipOp (com.hazelcast.cp.internal.operation.ChangeRaftGroupMembershipOp)1 DefaultRaftReplicateOp (com.hazelcast.cp.internal.operation.DefaultRaftReplicateOp)1 DestroyRaftGroupOp (com.hazelcast.cp.internal.operation.DestroyRaftGroupOp)1 RaftQueryOp (com.hazelcast.cp.internal.operation.RaftQueryOp)1 UnsafeRaftQueryOp (com.hazelcast.cp.internal.operation.unsafe.UnsafeRaftQueryOp)1 UnsafeRaftReplicateOp (com.hazelcast.cp.internal.operation.unsafe.UnsafeRaftReplicateOp)1 PromoteLiteMemberOp (com.hazelcast.internal.cluster.impl.operations.PromoteLiteMemberOp)1 IMap (com.hazelcast.map.IMap)1 DEFAULT_DESERIALIZE_RESULT (com.hazelcast.spi.impl.operationservice.InvocationBuilder.DEFAULT_DESERIALIZE_RESULT)1 InvocationRegistry (com.hazelcast.spi.impl.operationservice.impl.InvocationRegistry)1 OperationServiceImpl (com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl)1 Map (java.util.Map)1