14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
# File 'lib/test_prof/tps_prof/reporter/text.rb', line 14
def print(profiler)
groups = profiler.groups
total_tps = (profiler.total_count / profiler.total_time).round(2)
msgs = []
msgs <<
" Total TPS (tests per second): \#{total_tps}\n\n Top \#{profiler.top_count} slowest suites by TPS (tests per second) (min examples per group: \#{profiler.threshold}):\n\n MSG\n\n groups.each do |group|\n description = group[:id].top_level_description\n location = group[:id].metadata[:location]\n time = group[:run_time]\n group_time = group[:group_time]\n count = group[:count]\n tps = -group[:tps]\n\n msgs <<\n <<~GROUP\n \#{description.truncate} (\#{location}) \u2013 \#{tps} TPS (\#{time.duration} / \#{count}), group time: \#{group_time.duration}\n GROUP\n end\n\n log :info, msgs.join\nend\n"
|