@@ -45,15 +45,15 @@ def ping(opts = {})
45
45
46
46
warmup_repetitions . times { client . ping }
47
47
48
- start = Process . clock_gettime ( Process :: CLOCK_MONOTONIC )
48
+ start = current_time
49
49
results = measured_repetitions . times . collect do
50
50
Benchmark . realtime do
51
51
action_iterations . times do
52
52
client . ping
53
53
end
54
54
end
55
55
end
56
- end_time = Process . clock_gettime ( Process :: CLOCK_MONOTONIC )
56
+ end_time = current_time
57
57
58
58
options = { duration : end_time - start ,
59
59
operation : __method__ ,
@@ -82,15 +82,15 @@ def create_index(opts = {})
82
82
end
83
83
84
84
with_cleanup do
85
- start = Process . clock_gettime ( Process :: CLOCK_MONOTONIC )
85
+ start = current_time
86
86
results = measured_repetitions . times . collect do
87
87
Benchmark . realtime do
88
88
action_iterations . times do
89
89
client . indices . create ( index : "benchmarking-#{ Time . now . to_f } " )
90
90
end
91
91
end
92
92
end
93
- end_time = Process . clock_gettime ( Process :: CLOCK_MONOTONIC )
93
+ end_time = current_time
94
94
results
95
95
end
96
96
@@ -122,15 +122,15 @@ def index_document_small(opts={})
122
122
end
123
123
124
124
with_cleanup do
125
- start = Process . clock_gettime ( Process :: CLOCK_MONOTONIC )
125
+ start = current_time
126
126
results = measured_repetitions . times . collect do
127
127
Benchmark . realtime do
128
128
action_iterations . times do
129
129
client . create ( index : INDEX , body : document )
130
130
end
131
131
end
132
132
end
133
- end_time = Process . clock_gettime ( Process :: CLOCK_MONOTONIC )
133
+ end_time = current_time
134
134
results
135
135
end
136
136
@@ -165,15 +165,15 @@ def index_document_large(opts={})
165
165
end
166
166
167
167
with_cleanup do
168
- start = Process . clock_gettime ( Process :: CLOCK_MONOTONIC )
168
+ start = current_time
169
169
results = measured_repetitions . times . collect do
170
170
Benchmark . realtime do
171
171
action_iterations . times do
172
172
client . create ( index : INDEX , body : document )
173
173
end
174
174
end
175
175
end
176
- end_time = Process . clock_gettime ( Process :: CLOCK_MONOTONIC )
176
+ end_time = current_time
177
177
results
178
178
end
179
179
@@ -208,15 +208,15 @@ def get_document_small(opts={})
208
208
client . get ( index : INDEX , id : id )
209
209
end
210
210
211
- start = Process . clock_gettime ( Process :: CLOCK_MONOTONIC )
211
+ start = current_time
212
212
results = measured_repetitions . times . collect do
213
213
Benchmark . realtime do
214
214
action_iterations . times do
215
215
client . get ( index : INDEX , id : id )
216
216
end
217
217
end
218
218
end
219
- end_time = Process . clock_gettime ( Process :: CLOCK_MONOTONIC )
219
+ end_time = current_time
220
220
results
221
221
end
222
222
@@ -251,15 +251,15 @@ def get_document_large(opts={})
251
251
client . get ( index : INDEX , id : id )
252
252
end
253
253
254
- start = Process . clock_gettime ( Process :: CLOCK_MONOTONIC )
254
+ start = current_time
255
255
results = measured_repetitions . times . collect do
256
256
Benchmark . realtime do
257
257
action_iterations . times do
258
258
client . get ( index : INDEX , id : id )
259
259
end
260
260
end
261
261
end
262
- end_time = Process . clock_gettime ( Process :: CLOCK_MONOTONIC )
262
+ end_time = current_time
263
263
end
264
264
265
265
options = { duration : end_time - start ,
@@ -301,15 +301,15 @@ def search_document_small(opts={})
301
301
client . search ( request )
302
302
end
303
303
304
- start = Process . clock_gettime ( Process :: CLOCK_MONOTONIC )
304
+ start = current_time
305
305
results = measured_repetitions . times . collect do
306
306
Benchmark . realtime do
307
307
action_iterations . times do
308
308
client . search ( request )
309
309
end
310
310
end
311
311
end
312
- end_time = Process . clock_gettime ( Process :: CLOCK_MONOTONIC )
312
+ end_time = current_time
313
313
end
314
314
315
315
options = { duration : end_time - start ,
@@ -350,15 +350,15 @@ def search_document_large(opts={})
350
350
client . search ( request )
351
351
end
352
352
353
- start = Process . clock_gettime ( Process :: CLOCK_MONOTONIC )
353
+ start = current_time
354
354
results = measured_repetitions . times . collect do
355
355
Benchmark . realtime do
356
356
action_iterations . times do
357
357
client . search ( request )
358
358
end
359
359
end
360
360
end
361
- end_time = Process . clock_gettime ( Process :: CLOCK_MONOTONIC )
361
+ end_time = current_time
362
362
results
363
363
end
364
364
@@ -398,7 +398,7 @@ def update_document(opts={})
398
398
body : { doc : { field : "#{ document [ field ] } -#{ i } " } } )
399
399
end
400
400
401
- start = Process . clock_gettime ( Process :: CLOCK_MONOTONIC )
401
+ start = current_time
402
402
results = measured_repetitions . times . collect do
403
403
Benchmark . realtime do
404
404
action_iterations . times do |i |
@@ -408,7 +408,7 @@ def update_document(opts={})
408
408
end
409
409
end
410
410
end
411
- end_time = Process . clock_gettime ( Process :: CLOCK_MONOTONIC )
411
+ end_time = current_time
412
412
results
413
413
end
414
414
0 commit comments