public void add(SampleResult res) {
if (!isSampleIncluded(res)) {
return;
}
SamplingStatCalculator row;
final String sampleLabel = res.getSampleLabel(useGroupName.isSelected());
synchronized (tableRows) {
row = tableRows.get(sampleLabel);
if (row == null) {
row = new SamplingStatCalculator(sampleLabel);
tableRows.put(row.getLabel(), row);
statModel.insertRow(row, statModel.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);
}
//statModel.fireTableDataChanged();
}