use of com.hazelcast.simulator.worker.operations.PerformanceStatsOperation in project hazelcast-simulator by hazelcast.
the class CoordinatorOperationProcessor method process.
@Override
public void process(SimulatorOperation op, SimulatorAddress source, Promise promise) throws Exception {
if (op instanceof FailureOperation) {
failureCollector.notify((FailureOperation) op);
} else if (op instanceof PerformanceStatsOperation) {
performanceStatsCollector.update(source, ((PerformanceStatsOperation) op).getPerformanceStats());
} else if (op instanceof LogOperation) {
LogOperation logOperation = (LogOperation) op;
LOGGER.log(logOperation.getLevel(), logOperation.getMessage());
} else {
throw new ProcessException("Unknown operation:" + op);
}
promise.answer("ok");
}
use of com.hazelcast.simulator.worker.operations.PerformanceStatsOperation in project hazelcast-simulator by hazelcast.
the class CoordinatorOperationProcessorTest method test_whenPerformanceStatsOperation.
@Test
public void test_whenPerformanceStatsOperation() throws Exception {
PerformanceStatsOperation op = mock(PerformanceStatsOperation.class);
Map<String, PerformanceStats> performanceStats = mock(Map.class);
when(op.getPerformanceStats()).thenReturn(performanceStats);
processor.process(op, address, promise);
verify(performanceStatsCollector).update(address, performanceStats);
}
Aggregations