use of com.hazelcast.simulator.probes.Probe in project hazelcast-simulator by hazelcast.
the class TestContainer_TimeStep_AsyncSupportTest method getProbeTotalCount.
private static long getProbeTotalCount(String probeName, TestContainer container) {
Map<String, Probe> probeMap = container.getProbeMap();
HdrProbe probe = (HdrProbe) probeMap.get(probeName);
Recorder recorder = probe.getRecorder();
return recorder.getIntervalHistogram().getTotalCount();
}
use of com.hazelcast.simulator.probes.Probe in project hazelcast-simulator by hazelcast.
the class TestPerformanceTracker method makeUpdate.
private void makeUpdate(long updateIntervalMillis, long currentTimeMillis) {
Map<String, Probe> probeMap = testContainer.getProbeMap();
Map<String, Histogram> intervalHistograms = new HashMap<String, Histogram>(probeMap.size());
long intervalPercentileLatency = -1;
double intervalMean = -1;
long intervalMaxLatency = -1;
long iterations = testContainer.iteration() - iterationsDuringWarmup;
long intervalOperationCount = iterations - lastIterations;
for (Map.Entry<String, Probe> entry : probeMap.entrySet()) {
String probeName = entry.getKey();
Probe probe = entry.getValue();
if (!(probe instanceof HdrProbe)) {
continue;
}
HdrProbe hdrProbe = (HdrProbe) probe;
Histogram intervalHistogram = hdrProbe.getRecorder().getIntervalHistogram();
intervalHistogram.setStartTimeStamp(lastUpdateMillis);
intervalHistogram.setEndTimeStamp(currentTimeMillis);
intervalHistograms.put(probeName, intervalHistogram);
long percentileValue = intervalHistogram.getValueAtPercentile(INTERVAL_LATENCY_PERCENTILE);
if (percentileValue > intervalPercentileLatency) {
intervalPercentileLatency = percentileValue;
}
double meanLatency = intervalHistogram.getMean();
if (meanLatency > intervalMean) {
intervalMean = meanLatency;
}
long maxValue = intervalHistogram.getMaxValue();
if (maxValue > intervalMaxLatency) {
intervalMaxLatency = maxValue;
}
if (probe.isPartOfTotalThroughput()) {
intervalOperationCount += intervalHistogram.getTotalCount();
}
}
this.intervalHistogramMap = intervalHistograms;
this.intervalLatency999PercentileNanos = intervalPercentileLatency;
this.intervalLatencyAvgNanos = intervalMean;
this.intervalLatencyMaxNanos = intervalMaxLatency;
this.intervalOperationCount = intervalOperationCount;
this.totalOperationCount += intervalOperationCount;
long intervalTimeDelta = currentTimeMillis - lastUpdateMillis;
long totalTimeDelta = currentTimeMillis - startMeasuringTime();
this.intervalThroughput = (intervalOperationCount * ONE_SECOND_IN_MILLIS) / (double) intervalTimeDelta;
this.totalThroughput = (totalOperationCount * ONE_SECOND_IN_MILLIS / (double) totalTimeDelta);
this.lastIterations = iterations;
this.nextUpdateMillis += updateIntervalMillis;
this.lastUpdateMillis = currentTimeMillis;
}
use of com.hazelcast.simulator.probes.Probe in project hazelcast-simulator by hazelcast.
the class TestPerformanceTracker method skipUpdate.
private boolean skipUpdate(long updateIntervalMillis, long currentTimeMillis) {
long runStartedMillis = testContainer.getRunStartedMillis();
if (!testContainer.isRunning() || runStartedMillis == 0) {
// the test hasn't started
return true;
}
if (lastUpdateMillis == 0) {
// first time
iterationsDuringWarmup = testContainer.iteration();
for (Probe probe : testContainer.getProbeMap().values()) {
probe.reset();
}
lastUpdateMillis = currentTimeMillis;
nextUpdateMillis = lastUpdateMillis + updateIntervalMillis;
return true;
}
return nextUpdateMillis > currentTimeMillis;
}
use of com.hazelcast.simulator.probes.Probe in project hazelcast-simulator by hazelcast.
the class PropertyBinding method getOrCreateProbe.
public Probe getOrCreateProbe(String probeName, boolean partOfTotalThroughput) {
if (probeClass == null) {
return EmptyProbe.INSTANCE;
}
Probe probe = probeMap.get(probeName);
if (probe == null) {
probe = new HdrProbe(partOfTotalThroughput);
probeMap.put(probeName, probe);
}
return probe;
}
use of com.hazelcast.simulator.probes.Probe in project hazelcast-simulator by hazelcast.
the class TestContainer method registerTestPhaseTasks.
private void registerTestPhaseTasks() {
try {
registerSetupTask();
registerPrepareTasks(false);
registerPrepareTasks(true);
taskPerPhaseMap.put(RUN, new Callable() {
@Override
public Object call() throws Exception {
if (propertyBinding.recordJitter) {
Probe probe = propertyBinding.getOrCreateProbe("jitter", false);
new JitterThread(testContext, probe, propertyBinding.recordJitterThresholdNs).start();
}
return runStrategy.getRunCallable().call();
}
});
registerTask(Verify.class, new VerifyFilter(false), LOCAL_VERIFY);
registerTask(Verify.class, new VerifyFilter(true), GLOBAL_VERIFY);
registerTask(Teardown.class, new TeardownFilter(false), LOCAL_TEARDOWN);
registerTask(Teardown.class, new TeardownFilter(true), GLOBAL_TEARDOWN);
} catch (IllegalTestException e) {
throw rethrow(e);
} catch (Exception e) {
throw new IllegalTestException(format("Error during search for annotated test methods in %s: [%s] %s", testClass.getName(), e.getClass().getSimpleName(), e.getMessage()), e);
}
}
Aggregations