@Override public void add(final SampleResult res) { final String sampleLabel = res.getSampleLabel(); // Sampler selection if (columnSelection.isSelected() && pattern != null) { matcher = pattern.matcher(sampleLabel); } if ((matcher == null) || (matcher.find())) { JMeterUtils.runSafe( new Runnable() { @Override public void run() { SamplingStatCalculator row = null; synchronized (lock) { row = tableRows.get(sampleLabel); if (row == null) { row = new SamplingStatCalculator(sampleLabel); tableRows.put(row.getLabel(), row); model.insertRow(row, model.getRowCount() - 1); } } row.addSample(res); tableRows.get(TOTAL_ROW_LABEL).addSample(res); model.fireTableDataChanged(); } }); } }
@Override public void add(final SampleResult res) { JMeterUtils.runSafe( new Runnable() { @Override public void run() { if (isSampleIncluded(res)) { SamplingStatCalculator row = null; final String sampleLabel = res.getSampleLabel(useGroupName.isSelected()); synchronized (lock) { row = tableRows.get(sampleLabel); if (row == null) { row = new SamplingStatCalculator(sampleLabel); tableRows.put(row.getLabel(), row); model.insertRow(row, model.getRowCount() - 1); } } /* * Synch is needed because multiple threads can update the * counts. */ synchronized (row) { row.addSample(res); } SamplingStatCalculator tot = tableRows.get(TOTAL_ROW_LABEL); synchronized (tot) { tot.addSample(res); } model.fireTableDataChanged(); } } }); }