public static double getValue(SampleResult res) { return ((double) res.getTime()) / 1000d; } }
public static double getValue(SampleResult res) { return ((double) res.getTime()) / 1000d; } }
public static double getValue(SampleResult res) { return ((double) res.getTime()) / 1000d; } }
protected synchronized void updateTextFields(SampleResult res) { noSamplesField.setText(Long.toString(calc.getCount())); if(res.getSampleCount() > 0) { dataField.setText(Long.toString(res.getTime()/res.getSampleCount())); } else { dataField.setText("0"); } averageField.setText(Long.toString((long) calc.getMean())); deviationField.setText(Long.toString((long) calc.getStandardDeviation())); }
public class MyResultCollector extends ResultCollector { public MyResultCollector(Summariser summer) { super(summer); } @Override public void sampleOccurred(SampleEvent e) { super.sampleOccurred(e); SampleResult r = e.getResult(); if (r.isSuccessful()) { System.out.println("Response time in milliseconds: " + r.getTime()); } } }
/** * Used for each SampleResult * @param res {@link SampleResult} */ public void addSample(SampleResult res) { counter += res.getSampleCount(); errorCount += res.getErrorCount(); long aTimeInMillis = res.getTime(); runningSum += aTimeInMillis; if (aTimeInMillis > max) { max = aTimeInMillis; } if (aTimeInMillis < min) { min = aTimeInMillis; } // We want end time to be current time so sample rates reflect real time endTime = System.currentTimeMillis(); }
@Override public void add(SampleResult res) { if (!isSampleIncluded(res)) { return; } super.add(res); String threadName = res.getThreadName(); // SUBString to extract thread group name from thread name threadName = threadName.lastIndexOf(" ") >= 0 ? threadName.substring(0, threadName.lastIndexOf(" ")) : threadName; //fix response to fast can miss points long timeForAgg = Math.max(getGranulation(), res.getTime()); addThreadGroupRecord(threadName, normalizeTime(res.getEndTime()), res.getGroupThreads(), timeForAgg); updateGui(null); }
@Override public void add(SampleResult res) { if (!isSampleIncluded(res)) { return; } super.add(res); String threadName = res.getThreadName(); // SUBString to extract thread group name from thread name threadName = threadName.lastIndexOf(" ") >= 0 ? threadName.substring(0, threadName.lastIndexOf(" ")) : threadName; //fix response to fast can miss points long timeForAgg = Math.max(getGranulation(), res.getTime()); addThreadGroupRecord(threadName, normalizeTime(res.getEndTime()), res.getGroupThreads(), timeForAgg); updateGui(null); }
@Override public void add(SampleResult res) { if (!isSampleIncluded(res)) { return; } super.add(res); String threadName = res.getThreadName(); // SUBString to extract thread group name from thread name threadName = threadName.lastIndexOf(" ") >= 0 ? threadName.substring(0, threadName.lastIndexOf(" ")) : threadName; //fix response to fast can miss points long timeForAgg = Math.max(getGranulation(), res.getTime()); addThreadGroupRecord(threadName, normalizeTime(res.getEndTime()), res.getGroupThreads(), timeForAgg); updateGui(null); }
@Override public synchronized void sampleOccurred(SampleEvent se) { // TODO: make the interval configurable long sec = System.currentTimeMillis() / 1000; if (sec != cur && count > 0) { if (cur == 0) { begin = sec; } log.debug(cur + " " + begin); flush(sec - begin); cur = sec; } SampleResult res = se.getResult(); count++; sumRTime += res.getTime(); sumLatency += res.getLatency(); errors += res.isSuccessful() ? 0 : 1; threads = res.getAllThreads(); }
@Override public synchronized void sampleOccurred(SampleEvent se) { // TODO: make the interval configurable long sec = System.currentTimeMillis() / 1000; if (sec != cur && count > 0) { if (cur == 0) { begin = sec; } log.debug(cur + " " + begin); flush(sec - begin); cur = sec; } SampleResult res = se.getResult(); count++; sumRTime += res.getTime(); sumLatency += res.getLatency(); errors += res.isSuccessful() ? 0 : 1; threads = res.getAllThreads(); }
@Override public void add(SampleResult res) { if (!isSampleIncluded(res)) { return; } String label = res.getSampleLabel(); String aggregateLabel = "Overall Response Times"; GraphRowPercentiles row = (GraphRowPercentiles) model.get(label); GraphRowPercentiles rowAgg = (GraphRowPercentiles) modelAggregate.get(label); if (row == null) { row = (GraphRowPercentiles) getNewRow(model, AbstractGraphRow.ROW_PERCENTILES, label, AbstractGraphRow.MARKER_SIZE_NONE, false, false, false, true, false); } if (rowAgg == null) { rowAgg = (GraphRowPercentiles) getNewRow(modelAggregate, AbstractGraphRow.ROW_PERCENTILES, aggregateLabel, AbstractGraphRow.MARKER_SIZE_NONE, false, false, false, true, Color.RED, false); } row.add(res.getTime(), 1); rowAgg.add(res.getTime(), 1); updateGui(null); }
@Override public void add(SampleResult res) { if (!isSampleIncluded(res)) { return; } String label = res.getSampleLabel(); String aggregateLabel = "Overall Response Times"; GraphRowPercentiles row = (GraphRowPercentiles) model.get(label); GraphRowPercentiles rowAgg = (GraphRowPercentiles) modelAggregate.get(label); if (row == null) { row = (GraphRowPercentiles) getNewRow(model, AbstractGraphRow.ROW_PERCENTILES, label, AbstractGraphRow.MARKER_SIZE_NONE, false, false, false, true, false); } if (rowAgg == null) { rowAgg = (GraphRowPercentiles) getNewRow(modelAggregate, AbstractGraphRow.ROW_PERCENTILES, aggregateLabel, AbstractGraphRow.MARKER_SIZE_NONE, false, false, false, true, Color.RED, false); } row.add(res.getTime(), 1); rowAgg.add(res.getTime(), 1); updateGui(null); }
public void addSubSamplerResult(SampleResult res) { // Another subsample for the transaction calls++; // Set Response code of transaction if (noFailingSamples == 0) { transactionSampleResult.setResponseCode(res.getResponseCode()); } // The transaction fails if any sub sample fails if (!res.isSuccessful()) { transactionSampleResult.setSuccessful(false); noFailingSamples++; } // Add the sub result to the transaction result transactionSampleResult.addSubResult(res, false); // Add current time to total for later use (exclude pause time) totalTime += res.getTime(); }
@Override public void add(SampleResult res) { if (!isSampleIncluded(res)) { return; } super.add(res); addThreadGroupRecord(res.getSampleLabel(), normalizeTime(res.getEndTime()), res.getTime()); updateGui(null); }
/** * Add details for a sample result, which may consist of multiple samples. * Updates the number of bytes read and sent, error count, startTime and elapsedTime * @param res the sample result; might represent multiple values */ public void addSample(SampleResult res) { addBytes(res.getBytesAsLong()); addSentBytes(res.getSentBytes()); addValue(res.getTime(),res.getSampleCount()); errors+=res.getErrorCount(); // account for multiple samples if (startTime == 0){ // not yet initialised startTime=res.getStartTime(); } else { startTime = Math.min(startTime, res.getStartTime()); } elapsedTime = Math.max(elapsedTime, res.getEndTime()-startTime); }
@Override public void add(SampleResult res) { if (!isSampleIncluded(res)) { return; } super.add(res); addThreadGroupRecord(res.getSampleLabel(), normalizeTime(res.getEndTime()), res.getTime()); updateGui(null); }
@Override public void add(SampleResult res) { if (!isSampleIncluded(res)) { return; } super.add(res); addThreadGroupRecord(res.getSampleLabel(), normalizeTime(res.getEndTime()), res.getTime()); updateGui(null); }