File tree 1 file changed +19
-9
lines changed
1 file changed +19
-9
lines changed Original file line number Diff line number Diff line change 30
30
31
31
import java .util .Arrays ;
32
32
import java .util .Collection ;
33
+ import java .util .Date ;
33
34
34
35
/**
35
36
* @author Michele Rastelli
@@ -41,27 +42,36 @@ public class SimpleSyncPerfTest {
41
42
private final ArangoDB arangoDB ;
42
43
43
44
@ Parameterized .Parameters
44
- public static Collection <ArangoDB > builders () {
45
+ public static Collection <Protocol > protocols () {
45
46
return Arrays .asList (
46
- new ArangoDB . Builder (). useProtocol ( Protocol .HTTP_VPACK ). build () ,
47
- new ArangoDB . Builder (). useProtocol ( Protocol .HTTP_JSON ). build () ,
48
- new ArangoDB . Builder (). useProtocol ( Protocol .VST ). build ()
47
+ Protocol .HTTP_VPACK ,
48
+ Protocol .HTTP_JSON ,
49
+ Protocol .VST
49
50
);
50
51
}
51
52
52
- public SimpleSyncPerfTest (final ArangoDB arangoDB ) {
53
- this .arangoDB = arangoDB ;
53
+ public SimpleSyncPerfTest (final Protocol protocol ) {
54
+ System .out .println ("---" );
55
+ System .out .println (protocol );
56
+ this .arangoDB = new ArangoDB .Builder ().useProtocol (protocol ).build ();
54
57
}
55
58
56
59
@ Before
57
60
public void warmup () {
58
- getVersion ();
61
+ doGetVersion ();
59
62
}
60
63
61
- @ Test
62
- public void getVersion () {
64
+ private void doGetVersion () {
63
65
for (int i = 0 ; i < REPETITIONS ; i ++) {
64
66
arangoDB .getVersion ();
65
67
}
66
68
}
69
+
70
+ @ Test
71
+ public void getVersion () {
72
+ long start = new Date ().getTime ();
73
+ doGetVersion ();
74
+ long end = new Date ().getTime ();
75
+ System .out .println ("elapsed ms: " + (end - start ));
76
+ }
67
77
}
You can’t perform that action at this time.
0 commit comments