@@ -46,14 +46,14 @@ def ping(opts = {})
4646 warmup_repetitions . times { client . ping }
4747
4848 results = measured_repetitions . times . collect do
49- start = Time . now
49+ start = Process . clock_gettime ( Process :: CLOCK_MONOTONIC )
5050 Benchmark . realtime do
5151 action_iterations . times do
5252 client . ping
5353 end
5454 end
5555 end
56- end_time = Time . now
56+ end_time = Process . clock_gettime ( Process :: CLOCK_MONOTONIC )
5757
5858 options = { duration : end_time - start ,
5959 operation : __method__ ,
@@ -82,15 +82,15 @@ def create_index(opts = {})
8282 end
8383
8484 with_cleanup do
85- start = Time . now
85+ start = Process . clock_gettime ( Process :: CLOCK_MONOTONIC )
8686 results = measured_repetitions . times . collect do
8787 Benchmark . realtime do
8888 action_iterations . times do
8989 client . indices . create ( index : "benchmarking-#{ Time . now . to_f } " )
9090 end
9191 end
9292 end
93- end_time = Time . now
93+ end_time = Process . clock_gettime ( Process :: CLOCK_MONOTONIC )
9494 results
9595 end
9696
@@ -122,15 +122,15 @@ def index_document_small(opts={})
122122 end
123123
124124 with_cleanup do
125- start = Time . now
125+ start = Process . clock_gettime ( Process :: CLOCK_MONOTONIC )
126126 results = measured_repetitions . times . collect do
127127 Benchmark . realtime do
128128 action_iterations . times do
129129 client . create ( index : INDEX , body : document )
130130 end
131131 end
132132 end
133- end_time = Time . now
133+ end_time = Process . clock_gettime ( Process :: CLOCK_MONOTONIC )
134134 results
135135 end
136136
@@ -165,15 +165,15 @@ def index_document_large(opts={})
165165 end
166166
167167 with_cleanup do
168- start = Time . now
168+ start = Process . clock_gettime ( Process :: CLOCK_MONOTONIC )
169169 results = measured_repetitions . times . collect do
170170 Benchmark . realtime do
171171 action_iterations . times do
172172 client . create ( index : INDEX , body : document )
173173 end
174174 end
175175 end
176- end_time = Time . now
176+ end_time = Process . clock_gettime ( Process :: CLOCK_MONOTONIC )
177177 results
178178 end
179179
@@ -208,15 +208,15 @@ def get_document_small(opts={})
208208 client . get ( index : INDEX , id : id )
209209 end
210210
211- start = Time . now
211+ start = Process . clock_gettime ( Process :: CLOCK_MONOTONIC )
212212 results = measured_repetitions . times . collect do
213213 Benchmark . realtime do
214214 action_iterations . times do
215215 client . get ( index : INDEX , id : id )
216216 end
217217 end
218218 end
219- end_time = Time . now
219+ end_time = Process . clock_gettime ( Process :: CLOCK_MONOTONIC )
220220 results
221221 end
222222
@@ -251,15 +251,15 @@ def get_document_large(opts={})
251251 client . get ( index : INDEX , id : id )
252252 end
253253
254- start = Time . now
254+ start = Process . clock_gettime ( Process :: CLOCK_MONOTONIC )
255255 results = measured_repetitions . times . collect do
256256 Benchmark . realtime do
257257 action_iterations . times do
258258 client . get ( index : INDEX , id : id )
259259 end
260260 end
261261 end
262- end_time = Time . now
262+ end_time = Process . clock_gettime ( Process :: CLOCK_MONOTONIC )
263263 end
264264
265265 options = { duration : end_time - start ,
@@ -301,15 +301,15 @@ def search_document_small(opts={})
301301 client . search ( request )
302302 end
303303
304- start = Time . now
304+ start = Process . clock_gettime ( Process :: CLOCK_MONOTONIC )
305305 results = measured_repetitions . times . collect do
306306 Benchmark . realtime do
307307 action_iterations . times do
308308 client . search ( request )
309309 end
310310 end
311311 end
312- end_time = Time . now
312+ end_time = Process . clock_gettime ( Process :: CLOCK_MONOTONIC )
313313 end
314314
315315 options = { duration : end_time - start ,
@@ -350,15 +350,15 @@ def search_document_large(opts={})
350350 client . search ( request )
351351 end
352352
353- start = Time . now
353+ start = Process . clock_gettime ( Process :: CLOCK_MONOTONIC )
354354 results = measured_repetitions . times . collect do
355355 Benchmark . realtime do
356356 action_iterations . times do
357357 client . search ( request )
358358 end
359359 end
360360 end
361- end_time = Time . now
361+ end_time = Process . clock_gettime ( Process :: CLOCK_MONOTONIC )
362362 results
363363 end
364364
@@ -398,7 +398,7 @@ def update_document(opts={})
398398 body : { doc : { field : "#{ document [ field ] } -#{ i } " } } )
399399 end
400400
401- start = Time . now
401+ start = Process . clock_gettime ( Process :: CLOCK_MONOTONIC )
402402 results = measured_repetitions . times . collect do
403403 Benchmark . realtime do
404404 action_iterations . times do |i |
@@ -408,7 +408,7 @@ def update_document(opts={})
408408 end
409409 end
410410 end
411- end_time = Time . now
411+ end_time = Process . clock_gettime ( Process :: CLOCK_MONOTONIC )
412412 results
413413 end
414414
0 commit comments