33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
(s 0)) ;; sum
(let ((start-time (current-milliseconds))
(run-id (+ r (make-run-id))))
(rmt:register-test run-id "test1" (conc "item_" i))
(thread-sleep! 0.01)
(let* ((qry-time (- (current-milliseconds) start-time))
(tot-query-time (+ qry-time s))
(avg-query-time (* 1.0 (/ tot-query-time i))))
(if (> qry-time 500)
(print "WARNING: rmt:register-test took more than 500ms, "qry-time"ms, i="i", avg-query-time="avg-query-time))
(if (eq? (modulo i 100) 0)
(print "For run-id="run-id", "(rmt:get-keys-write)" num tests registered="i" avg-query-time="avg-query-time))
(if (< i 500)
(loop r (+ i 1) tot-query-time)
(if (< r 100)
(let* ((start-time (current-milliseconds)))
(print "rmt:get-keys "(rmt:get-keys)" in "(- (current-milliseconds) start-time))
(print "Got "(length (rmt:get-tests-for-run run-id "%" '() '() 0 #f #f #f #f #f 0 #f))" tests for run "run-id)
(print "Average query time: "avg-query-time)
(loop (+ r 1) 0 tot-query-time))))))))
)))
(thread-start! th1)
(thread-join! th1)))
(run)
|
|
>
|
|
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
(s 0)) ;; sum
(let ((start-time (current-milliseconds))
(run-id (+ r (make-run-id))))
(rmt:register-test run-id "test1" (conc "item_" i))
(thread-sleep! 0.01)
(let* ((qry-time (- (current-milliseconds) start-time))
(tot-query-time (+ qry-time s))
(avg-query-time (* 1.0 (/ tot-query-time (max i 1)))))
(if (> qry-time 500)
(print "WARNING: rmt:register-test took more than 500ms, "qry-time"ms, i="i", avg-query-time="avg-query-time))
(if (eq? (modulo i 100) 0)
(print "For run-id="run-id", "(rmt:get-keys-write)" num tests registered="i" avg-query-time="avg-query-time))
(if (< i 500)
(loop r (+ i 1) tot-query-time)
(if (< r 100)
(let* ((start-time (current-milliseconds)))
(print "rmt:get-keys "(rmt:get-keys)" in "(- (current-milliseconds) start-time))
;; run-id testpatt states statuses offset limit not-in sort-by sort-order qryvals last-update mode
(print "Got "(length (rmt:get-tests-for-run run-id "%" '() '() #f #f #f #f #f #f 0 #f))" tests for run "run-id)
(print "Average query time: "avg-query-time)
(loop (+ r 1) 0 tot-query-time))))))))
)))
(thread-start! th1)
(thread-join! th1)))
(run)
|