Search in sources :

Example 1 with HdrProbe

use of com.hazelcast.simulator.probes.impl.HdrProbe 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();
}
Also used : HdrProbe(com.hazelcast.simulator.probes.impl.HdrProbe) Recorder(org.HdrHistogram.Recorder) Probe(com.hazelcast.simulator.probes.Probe) HdrProbe(com.hazelcast.simulator.probes.impl.HdrProbe)

Example 2 with HdrProbe

use of com.hazelcast.simulator.probes.impl.HdrProbe 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;
}
Also used : Histogram(org.HdrHistogram.Histogram) HdrProbe(com.hazelcast.simulator.probes.impl.HdrProbe) HashMap(java.util.HashMap) Probe(com.hazelcast.simulator.probes.Probe) HdrProbe(com.hazelcast.simulator.probes.impl.HdrProbe) HashMap(java.util.HashMap) Map(java.util.Map)

Example 3 with HdrProbe

use of com.hazelcast.simulator.probes.impl.HdrProbe 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;
}
Also used : HdrProbe(com.hazelcast.simulator.probes.impl.HdrProbe) EmptyProbe(com.hazelcast.simulator.probes.impl.EmptyProbe) Probe(com.hazelcast.simulator.probes.Probe) HdrProbe(com.hazelcast.simulator.probes.impl.HdrProbe)

Aggregations

Probe (com.hazelcast.simulator.probes.Probe)3 HdrProbe (com.hazelcast.simulator.probes.impl.HdrProbe)3 EmptyProbe (com.hazelcast.simulator.probes.impl.EmptyProbe)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Histogram (org.HdrHistogram.Histogram)1 Recorder (org.HdrHistogram.Recorder)1