Search in sources :

Example 11 with PerformanceStats

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);
}
Also used : PerformanceStats(com.hazelcast.simulator.worker.performance.PerformanceStats) PerformanceStatsOperation(com.hazelcast.simulator.worker.operations.PerformanceStatsOperation) Test(org.junit.Test)

Example 12 with 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());
}
Also used : PerformanceStats(com.hazelcast.simulator.worker.performance.PerformanceStats) Test(org.junit.Test)

Example 13 with PerformanceStats

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"));
}
Also used : PerformanceStats(com.hazelcast.simulator.worker.performance.PerformanceStats) HashMap(java.util.HashMap) SimulatorAddress(com.hazelcast.simulator.protocol.core.SimulatorAddress) Test(org.junit.Test)

Example 14 with PerformanceStats

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"));
}
Also used : PerformanceStats(com.hazelcast.simulator.worker.performance.PerformanceStats) Test(org.junit.Test)

Aggregations

PerformanceStats (com.hazelcast.simulator.worker.performance.PerformanceStats)14 Test (org.junit.Test)9 SimulatorAddress (com.hazelcast.simulator.protocol.core.SimulatorAddress)6 HashMap (java.util.HashMap)6 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)2 AgentData.publicAddressesString (com.hazelcast.simulator.coordinator.registry.AgentData.publicAddressesString)1 FileUtils.getConfigurationFile (com.hazelcast.simulator.utils.FileUtils.getConfigurationFile)1 PerformanceStatsOperation (com.hazelcast.simulator.worker.operations.PerformanceStatsOperation)1 File (java.io.File)1 Map (java.util.Map)1 ConcurrentMap (java.util.concurrent.ConcurrentMap)1