66import com .fasterxml .jackson .annotation .JsonSubTypes ;
77import com .fasterxml .jackson .annotation .JsonTypeInfo ;
88import com .fasterxml .jackson .annotation .JsonTypeName ;
9+
910import java .util .Collections ;
1011import java .util .List ;
1112import java .util .Map ;
1213import org .apache .jmeter .threads .ThreadGroup ;
1314import us .abstracta .jmeter .javadsl .core .threadgroups .BaseThreadGroup .SampleErrorAction ;
1415
15- public class UserLoad {
16+ public class UserProfile {
1617
1718 // we don't need getters since Jackson gets the values from fields
1819 private final String name = "" ;
1920 private final String virtualUserId ;
2021 private final String providerId ;
21- private final String region ;
22- private final UserLoadStrategy strategy ;
23- private final BandwidthSettings bandwidth = new BandwidthSettings ();
24- private final BrowserSettings browser = new BrowserSettings ();
25- private final DnsSettings dns = new DnsSettings ();
26- private final ThinkTimeSettings thinktime = new ThinkTimeSettings ();
22+ private final String location ;
23+ private final UserLoadStrategy load ;
2724 private final MemorySettings memory = new MemorySettings ();
28- private final JtlSettings jtl = new JtlSettings ();
29- private final PropertiesSettings properties = new PropertiesSettings ();
30- private final SetUpTearDownSettings setUp = null ;
31- private final SetUpTearDownSettings tearDown = null ;
25+ private final Engine engine = new Engine ();
3226
33- public UserLoad () {
27+ public UserProfile () {
3428 virtualUserId = null ;
3529 providerId = null ;
36- region = null ;
37- strategy = null ;
30+ location = null ;
31+ load = null ;
3832 }
3933
40- public UserLoad (String virtualUserId , String providerId , String region ,
34+ public UserProfile (String virtualUserId , String providerId , String location ,
4135 UserLoadStrategy strategy ) {
4236 this .virtualUserId = virtualUserId ;
4337 this .providerId = providerId ;
44- this .region = region ;
45- this .strategy = strategy ;
38+ this .location = location ;
39+ this .load = strategy ;
4640 }
4741
4842 @ JsonTypeInfo (use = NAME , include = PROPERTY )
@@ -53,25 +47,24 @@ public abstract static class UserLoadStrategy {
5347
5448 }
5549
56- @ JsonTypeName ("UserLoadRampup " )
50+ @ JsonTypeName ("UserProfileLoadRampUp " )
5751 public static class UserLoadRampUp extends UserLoadStrategy {
5852
59- private final int userload ;
60- private final long rampup ;
61- private final long peak ;
62- private final long delay = 0 ;
63- private final SampleErrorAction onSampleError = SampleErrorAction .CONTINUE ;
53+ private final int plateauVus ;
54+ private final long rampUpMs ;
55+ private final long plateauMs ;
56+ private final long delayMs = 0 ;
6457
6558 public UserLoadRampUp () {
66- userload = 0 ;
67- rampup = 0 ;
68- peak = 0 ;
59+ plateauVus = 0 ;
60+ rampUpMs = 0 ;
61+ plateauMs = 0 ;
6962 }
7063
7164 public UserLoadRampUp (int userLoad , long rampUpMillis , long peakMillis ) {
72- this .userload = userLoad ;
73- this .rampup = rampUpMillis ;
74- this .peak = peakMillis ;
65+ this .plateauVus = userLoad ;
66+ this .rampUpMs = rampUpMillis ;
67+ this .plateauMs = peakMillis ;
7568 }
7669
7770 public static UserLoadRampUp fromThreadGroup (ThreadGroup threadGroup ) {
@@ -85,6 +78,38 @@ public static UserLoadRampUp fromThreadGroup(ThreadGroup threadGroup) {
8578
8679 }
8780
81+ @ JsonTypeInfo (use = NAME , include = PROPERTY )
82+ @ JsonTypeName ("JmeterUserProfileEngine" )
83+ public static class Engine {
84+
85+ private final EngineSettings settings = new EngineSettings ();
86+ private final BrowserSettings browser = new BrowserSettings ();
87+ private final BandwidthSettings bandwidth = new BandwidthSettings ();
88+ private final DnsSettings dns = new DnsSettings ();
89+ private final JtlSettings jtl = new JtlSettings ();
90+ private final PropertiesSettings properties = new PropertiesSettings ();
91+
92+ }
93+
94+ public static class EngineSettings {
95+
96+ private final ExternalLiveReportingSettings externalLiveReporting = new ExternalLiveReportingSettings ();
97+ private final SampleErrorAction errorHandling = SampleErrorAction .CONTINUE ;
98+ private final ThinkTimeSettings thinkTime = new ThinkTimeSettings ();
99+ private final SetUpTearDownSettings setUp = null ;
100+ private final SetUpTearDownSettings tearDown = null ;
101+
102+ }
103+
104+ @ JsonTypeInfo (use = NAME , include = PROPERTY )
105+ @ JsonTypeName ("JmeterExternalLiveReportingSettings" )
106+ public static class ExternalLiveReportingSettings {
107+
108+ private final List <String > listeners = Collections .emptyList ();
109+ private final int queueSize = 5000 ;
110+
111+ }
112+
88113 public static class SetUpTearDownSettings {
89114
90115 }
@@ -102,6 +127,8 @@ public static class BrowserSettings {
102127 private final String userAgent = "" ;
103128 private final CacheManager cache = new CacheManager ();
104129 private final CookiesManager cookies = new CookiesManager ();
130+ private final Boolean downloadResources = null ;
131+ private final Boolean keepAlive = null ;
105132
106133 }
107134
0 commit comments