22
23
24
25
26
27
28
29
30
31
32
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
|
# File 'lib/ritsudo/result/uncompletable.rb', line 22
def report(outliters_stdev_multiple: nil)
puts "[#{name}]"
table_data = []
(@requests || []).uniq.each do |url|
if @completed[url] && !@completed[url].empty?
all_request_times = @completed[url]
use_remove_outliters = outliters_stdev_multiple && all_request_times.size > 1
if use_remove_outliters
request_times = Ritsudo::Result::Helper.remove_outliters(all_request_times, outliters_stdev_multiple)
else
request_times = all_request_times
end
avg = (request_times.sum(0.0) / request_times.length)&.round(2)
max = request_times.max&.round(2)
min = request_times.min&.round(2)
count = request_times.size
else
avg = max = min = count = "-"
end
result = {
url: url[0..100],
avg: avg,
max: max,
min: min,
count: count,
uncompleted: @uncompleted[url],
outliters: all_request_times.size - request_times.size
}
table_data << result
end
Formatador.display_table(table_data, [:url, :avg, :max, :min, :count, :uncompleted, :outliters])
end
|