Jagger
 All Classes Namespaces Files Functions Variables Enumerator Groups Pages
JLoadScenario ExampleJLoadScenarioProvider.exampleJaggerLoadScenario ( )

Definition at line 55 of file ExampleJLoadScenarioProvider.java.

References com.griddynamics.jagger.user.test.configurations.load.JLoadProfileRps.Builder.build(), com.griddynamics.jagger.user.test.configurations.JLoadTest.Builder.build(), com.griddynamics.jagger.user.test.configurations.limits.JLimitVsBaseline.builder(), com.griddynamics.jagger.user.test.configurations.limits.JLimitVsRefValue.builder(), com.griddynamics.jagger.user.test.configurations.JParallelTestsGroup.builder(), com.griddynamics.jagger.user.test.configurations.JLoadScenario.builder(), com.griddynamics.jagger.user.test.configurations.load.JLoadProfileRps.builder(), com.griddynamics.jagger.user.test.configurations.JLoadTest.builder(), com.griddynamics.jagger.user.test.configurations.JTestDefinition.builder(), ExampleCustomHttpInvokerProvider.nonVerbose(), com.griddynamics.jagger.user.test.configurations.limits.auxiliary.LowWarnThresh.of(), com.griddynamics.jagger.user.test.configurations.limits.auxiliary.LowErrThresh.of(), com.griddynamics.jagger.user.test.configurations.limits.auxiliary.UpErrThresh.of(), com.griddynamics.jagger.user.test.configurations.limits.auxiliary.UpWarnThresh.of(), com.griddynamics.jagger.user.test.configurations.limits.auxiliary.RefValue.of(), com.griddynamics.jagger.user.test.configurations.termination.auxiliary.IterationsNumber.of(), com.griddynamics.jagger.user.test.configurations.termination.auxiliary.MaxDurationInSeconds.of(), com.griddynamics.jagger.user.test.configurations.auxiliary.Id.of(), com.griddynamics.jagger.user.test.configurations.load.auxiliary.RequestsPerSecond.of(), com.griddynamics.jagger.engine.e1.collector.DefaultResponseValidatorProvider.of(), com.griddynamics.jagger.user.test.configurations.termination.JTerminationCriteriaIterations.of(), com.griddynamics.jagger.user.test.configurations.limits.auxiliary.JMetricName.PERF_LATENCY_PERCENTILE(), com.griddynamics.jagger.user.test.configurations.limits.auxiliary.JMetricName.PERF_SUCCESS_RATE_OK, com.griddynamics.jagger.user.test.configurations.limits.auxiliary.JMetricName.PERF_THROUGHPUT, com.griddynamics.jagger.user.test.configurations.JTestDefinition.Builder.withInvoker(), com.griddynamics.jagger.user.test.configurations.limits.JLimit.Builder.withOnlyErrors(), and com.griddynamics.jagger.user.test.configurations.load.JLoadProfileRps.Builder.withWarmUpTimeInMilliseconds().

55  {
56 
57  // Example of using JaggerPropertiesProvider
58  String testDefinitionComment = getTestPropertyValue("example.jagger.test.definition.comment");
59 
60  JTestDefinition jTestDefinition = JTestDefinition
61  .builder(Id.of("exampleJaggerTestDefinition"), new ExampleEndpointsProvider())
62  // optional
63  .withComment(testDefinitionComment)
65  .withQueryProvider(new ExampleQueriesProvider())
66  .withLoadBalancer(new RoundRobinLoadBalancer())
67  .addValidator(new ExampleResponseValidatorProvider("we are always good"))
69  .addListener(new NotNullInvocationListener())
70  .build();
71 
72  // Example of using JaggerPropertiesProvider
73  Long iterationsNumber = Long.valueOf(getTestPropertyValue("example.jagger.load.scenario.termination.iterations"));
74  Long maxDurationInSeconds = Long.valueOf(getTestPropertyValue("example.jagger.load.scenario.termination.max.duration.seconds"));
76  .of(IterationsNumber.of(iterationsNumber), MaxDurationInSeconds.of(maxDurationInSeconds));
77 
78  JLoadProfile jLoadProfileRps = JLoadProfileRps
80  .withMaxLoadThreads(10)
82  .build();
83 
84  // For standard metrics use JMetricName.
85  // JLimitVsRefValue is used to compare the results with the referenced value.
87  // the threshold is relative.
88  .withOnlyWarnings(LowWarnThresh.of(0.99), UpWarnThresh.of(1.01))
89  .build();
90 
91  // For standard metrics use JMetricName.
92  // JLimitVsBaseline is used to compare the results with the baseline.
93  // Use 'chassis.engine.e1.reporting.session.comparison.baseline.session.id' to set baseline.
95  // the threshold is relative.
96  .withOnlyErrors(LowErrThresh.of(0.99), UpErrThresh.of(1.00001))
97  .build();
98 
99  // For standard metrics use JMetricName.
100  // JMetricName.PERF_LATENCY_PERCENTILE is used to set limits for latency percentile metrics.
101  JLimit latencyPercentileLimit = JLimitVsRefValue.builder(JMetricName.PERF_LATENCY_PERCENTILE(95D), RefValue.of(0.1D))
102  // the threshold is relative.
103  .withOnlyWarnings(LowWarnThresh.of(0.50), UpWarnThresh.of(1.5))
104  .build();
105 
106 
107  JLoadTest jLoadTest = JLoadTest
108  .builder(Id.of("exampleJaggerLoadTest"), jTestDefinition, jLoadProfileRps, jTerminationCriteria)
109  .addListener(new CollectThreadsTestListener())
110  .withLimits(successRateLimit, throughputLimit, latencyPercentileLimit)
111  .build();
112 
113  JParallelTestsGroup jParallelTestsGroup = JParallelTestsGroup
114  .builder(Id.of("exampleJaggerParallelTestsGroup"), jLoadTest)
115  .addListener(new ExampleTestGroupListener())
116  .build();
117 
118  // For JLoadScenario which is supposed to be executed by Jagger its ID must be set to 'jagger.load.scenario.id.to.execute' property's value
119  return JLoadScenario.builder(Id.of("exampleJaggerLoadScenario"), jParallelTestsGroup)
120  .addListener(new ExampleLoadScenarioListener())
121  .withLatencyPercentiles(Arrays.asList(10D, 25.5D, 42D, 95D))
122  .build();
123  }

Here is the call graph for this function: