-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add showTimeline in TestPlan to ease reviewing thread groups configur…
…ations in test plans Now is not needed to move the thread group separate from the test plan to be able to invoke showTimeline, just invoke it in test plan and get timelines for all thread groups in the testplan
- Loading branch information
1 parent
6b2a0b3
commit 0ef288b
Showing
6 changed files
with
182 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
...er-java-dsl/src/main/java/us/abstracta/jmeter/javadsl/core/threadgroups/LoadTimeLine.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package us.abstracta.jmeter.javadsl.core.threadgroups; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import javax.swing.JComponent; | ||
import us.abstracta.jmeter.javadsl.core.util.SingleSeriesTimelinePanel; | ||
|
||
public class LoadTimeLine { | ||
|
||
private final String name; | ||
private final String loadUnit; | ||
private final List<TimePoint> timePoints = new ArrayList<>(); | ||
|
||
public LoadTimeLine(String name, String loadUnit) { | ||
this.name = name; | ||
this.loadUnit = loadUnit; | ||
} | ||
|
||
public void add(long timeMillis, double value) { | ||
timePoints.add(new TimePoint(timeMillis, value)); | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public JComponent buildChart() { | ||
SingleSeriesTimelinePanel ret = new SingleSeriesTimelinePanel(loadUnit); | ||
for (TimePoint tp : timePoints) { | ||
ret.add(tp.timeMillis, tp.value); | ||
} | ||
return ret; | ||
} | ||
|
||
public long getMaxTime() { | ||
return timePoints.stream() | ||
.mapToLong(tp -> tp.timeMillis) | ||
.max() | ||
.orElse(0L); | ||
} | ||
|
||
private static class TimePoint { | ||
|
||
private final long timeMillis; | ||
private final double value; | ||
|
||
private TimePoint(long timeIncrMillis, double value) { | ||
this.timeMillis = timeIncrMillis; | ||
this.value = value; | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters