use of com.hazelcast.simulator.worker.performance.PerformanceStats 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);
}
use of com.hazelcast.simulator.worker.performance.PerformanceStats in project hazelcast-simulator by hazelcast.
the class PerformanceStatsCollectorTest method testGet_testCaseNotFound.
@Test
public void testGet_testCaseNotFound() {
PerformanceStats performanceStats = performanceStatsCollector.get("notFound", true);
assertTrue(performanceStats.isEmpty());
}
use of com.hazelcast.simulator.worker.performance.PerformanceStats in project hazelcast-simulator by hazelcast.
the class PerformanceStatsCollectorTest method testFormatPerformanceNumbers_avgLatencyOverMicrosThreshold.
@Test
public void testFormatPerformanceNumbers_avgLatencyOverMicrosThreshold() throws Exception {
SimulatorAddress worker = workerAddress(3, 1);
Map<String, PerformanceStats> performanceStats = new HashMap<String, PerformanceStats>();
performanceStats.put(TEST_CASE_ID_1, new PerformanceStats(800, 100, 300, SECONDS.toNanos(3), MICROSECONDS.toNanos(2400), MICROSECONDS.toNanos(2500)));
performanceStatsCollector.update(worker, performanceStats);
String performance = performanceStatsCollector.formatIntervalPerformanceNumbers(TEST_CASE_ID_1);
assertTrue(performance.contains("ms"));
assertFalse(performance.contains("µs"));
}
use of com.hazelcast.simulator.worker.performance.PerformanceStats in project hazelcast-simulator by hazelcast.
the class PerformanceStatsCollectorTest method testFormatPerformanceNumbers.
@Test
public void testFormatPerformanceNumbers() {
update(a1w1, TEST_CASE_ID_1, new PerformanceStats(1000, 200, 500, 1900.0d, 1800, 2500));
String performance = performanceStatsCollector.formatIntervalPerformanceNumbers(TEST_CASE_ID_1);
assertTrue(performance.contains("ops"));
}
Aggregations