use of kg.apc.charting.rows.GraphRowExactValues in project jmeter-plugins by undera.
the class GraphRowExactValuesTest method testNext.
/**
* Test of next method, of class GraphRowExactValues.
*/
@Test
public void testNext() {
System.out.println("next");
GraphRowExactValues instance = new GraphRowExactValues();
instance.add(1, 1);
Iterator it = instance.iterator();
Entry result = (Entry) it.next();
Assert.assertEquals(1L, result.getKey());
}
use of kg.apc.charting.rows.GraphRowExactValues in project jmeter-plugins by undera.
the class VariableThroughputTimerGui method updateChart.
private void updateChart(VariableThroughputTimer tg) {
model.clear();
chart.clearErrorMessage();
AbstractGraphRow row = new GraphRowExactValues();
row.setColor(Color.BLUE);
row.setDrawLine(true);
row.setMarkerSize(AbstractGraphRow.MARKER_SIZE_NONE);
row.setDrawThickLines(true);
long now = System.currentTimeMillis();
int rowsCount = tableModel.getRowCount();
row.add(now, 0);
row.add(now, tg.getRPSForSecond(0).getLeft());
int duration = 0;
for (int i = 0; i < rowsCount; i++) {
row.add(now + (duration + 1) * 1000, tg.getRPSForSecond(duration + 1).getLeft());
int rowVal = getIntFromRow(i, 2);
if (rowVal < 0) {
chart.setErrorMessage("The values entered cannot be rendered in preview...");
break;
}
duration = duration + rowVal;
row.add(now + duration * 1000, tg.getRPSForSecond(duration).getLeft());
}
// -1 because row.add(thread.getStartTime() - 1, 0)
chart.setxAxisLabelRenderer(new DateTimeRenderer(DateTimeRenderer.HHMMSS, now - 1));
chart.setForcedMinX(now);
model.put("Expected RPS", row);
chart.invalidateCache();
chart.repaint();
}
use of kg.apc.charting.rows.GraphRowExactValues in project jmeter-plugins by undera.
the class AbstractDynamicThreadGroupGui method updateChart.
protected void updateChart(AbstractDynamicThreadGroup atg) {
double targetRate = atg.getTargetLevelAsDouble();
long rampUp = atg.getRampUpSeconds();
long holdFor = atg.getHoldSeconds();
long stepsCount = atg.getStepsAsLong();
double unitFactor = atg.getUnitFactor();
chartModel.clear();
previewChart.clearErrorMessage();
AbstractGraphRow row = new GraphRowExactValues();
row.setColor(getRowColor());
row.setDrawLine(true);
row.setMarkerSize(AbstractGraphRow.MARKER_SIZE_NONE);
row.setDrawThickLines(true);
// initial value to force min Y
row.add(0, 0);
double totalArrivals = 0;
if (stepsCount > 0) {
double stepSize = targetRate / (double) stepsCount;
double stepLen = rampUp / (double) stepsCount;
for (int n = 1; n <= stepsCount; n++) {
double stepRate = stepSize * n;
row.add(Math.round((n - 1) * stepLen * 1000), stepRate);
row.add(Math.round(n * stepLen * 1000), stepRate);
totalArrivals += stepLen * stepRate;
}
} else {
row.add(rampUp * 1000, targetRate);
totalArrivals += rampUp * targetRate / 2.0;
}
row.add((rampUp + holdFor) * 1000, targetRate);
totalArrivals += holdFor * targetRate;
totalArrivals /= unitFactor;
previewChart.setxAxisLabelRenderer(new DateTimeRenderer(DateTimeRenderer.HHMMSS, 0));
chartModel.put(getRowLabel(totalArrivals), row);
}
use of kg.apc.charting.rows.GraphRowExactValues in project jmeter-plugins by undera.
the class GraphRowExactValuesTest method testAdd.
/**
* Test of add method, of class GraphRowExactValues.
*/
@Test
public void testAdd() {
System.out.println("add");
long xVal = 0L;
GraphRowExactValues instance = new GraphRowExactValues();
instance.add(xVal, 1);
instance.add(xVal, 2);
instance.add(xVal, 3);
}
use of kg.apc.charting.rows.GraphRowExactValues in project jmeter-plugins by undera.
the class GraphRowExactValuesTest method testRemove.
/**
* Test of remove method, of class GraphRowExactValues.
*/
@Test
public void testRemove() {
System.out.println("remove");
GraphRowExactValues instance = new GraphRowExactValues();
try {
instance.remove();
Assert.fail("Exception expected");
} catch (UnsupportedOperationException e) {
}
}
Aggregations