-
-
Notifications
You must be signed in to change notification settings - Fork 136
Expand file tree
/
Copy pathWebClientBenchmark.java
More file actions
31 lines (26 loc) · 898 Bytes
/
WebClientBenchmark.java
File metadata and controls
31 lines (26 loc) · 898 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package jenkins.benchmark.jmh.samples;
import jenkins.benchmark.jmh.JmhBenchmark;
import jenkins.benchmark.jmh.JmhBenchmarkState;
import jenkins.benchmark.jmh.JmhJenkinsRule;
import org.jvnet.hudson.test.JenkinsRule;
import org.openjdk.jmh.annotations.Benchmark;
@JmhBenchmark
public class WebClientBenchmark {
public static class MyState extends JmhBenchmarkState {
JenkinsRule.WebClient webClient = null;
@Override
public void setup() {
JmhJenkinsRule jenkinsRule = new JmhJenkinsRule();
getJenkins().setSecurityRealm(jenkinsRule.createDummySecurityRealm());
webClient = jenkinsRule.createWebClient();
}
@Override
public void tearDown() {
webClient.close();
}
}
@Benchmark
public void benchmark(MyState state) throws Exception {
state.webClient.goTo("");
}
}