use of com.hazelcast.scheduledexecutor.impl.ScheduledTaskStatisticsImpl in project hazelcast by hazelcast.
the class ClientScheduledFutureProxy method getStats.
@Override
public ScheduledTaskStatistics getStats() {
checkAccessibleHandler();
Address address = handler.getAddress();
String schedulerName = handler.getSchedulerName();
String taskName = handler.getTaskName();
int partitionId = handler.getPartitionId();
try {
if (address != null) {
ClientMessage request = ScheduledExecutorGetStatsFromAddressCodec.encodeRequest(schedulerName, taskName, address);
ClientMessage response = new ClientInvocation(getClient(), request, address).invoke().get();
ScheduledExecutorGetStatsFromAddressCodec.ResponseParameters responseParameters = ScheduledExecutorGetStatsFromAddressCodec.decodeResponse(response);
return new ScheduledTaskStatisticsImpl(responseParameters.totalRuns, responseParameters.lastIdleTimeNanos, responseParameters.totalRunTimeNanos, responseParameters.totalIdleTimeNanos);
} else {
ClientMessage request = ScheduledExecutorGetStatsFromPartitionCodec.encodeRequest(schedulerName, taskName);
ClientMessage response = new ClientInvocation(getClient(), request, partitionId).invoke().get();
ScheduledExecutorGetStatsFromAddressCodec.ResponseParameters responseParameters = ScheduledExecutorGetStatsFromAddressCodec.decodeResponse(response);
return new ScheduledTaskStatisticsImpl(responseParameters.totalRuns, responseParameters.lastIdleTimeNanos, responseParameters.totalRunTimeNanos, responseParameters.totalIdleTimeNanos);
}
} catch (Exception e) {
throw ExceptionUtil.rethrow(e);
}
}
use of com.hazelcast.scheduledexecutor.impl.ScheduledTaskStatisticsImpl in project hazelcast by hazelcast.
the class ClientScheduledFutureProxy method getStats.
@Override
public ScheduledTaskStatistics getStats() {
checkAccessibleHandler();
UUID uuid = handler.getUuid();
String schedulerName = handler.getSchedulerName();
String taskName = handler.getTaskName();
int partitionId = handler.getPartitionId();
if (uuid != null) {
ClientMessage request = ScheduledExecutorGetStatsFromMemberCodec.encodeRequest(schedulerName, taskName, uuid);
ClientMessage response = invokeOnMember(request, uuid);
ScheduledExecutorGetStatsFromMemberCodec.ResponseParameters responseParameters = ScheduledExecutorGetStatsFromMemberCodec.decodeResponse(response);
return new ScheduledTaskStatisticsImpl(responseParameters.totalRuns, responseParameters.lastIdleTimeNanos, responseParameters.totalRunTimeNanos, responseParameters.totalIdleTimeNanos, responseParameters.lastRunDurationNanos);
} else {
ClientMessage request = ScheduledExecutorGetStatsFromPartitionCodec.encodeRequest(schedulerName, taskName);
ClientMessage response = invokeOnPartition(request, partitionId);
ScheduledExecutorGetStatsFromMemberCodec.ResponseParameters responseParameters = ScheduledExecutorGetStatsFromMemberCodec.decodeResponse(response);
return new ScheduledTaskStatisticsImpl(responseParameters.totalRuns, responseParameters.lastIdleTimeNanos, responseParameters.totalRunTimeNanos, responseParameters.totalIdleTimeNanos, responseParameters.lastRunDurationNanos);
}
}
Aggregations