Module: Minitest::Perf::Statistics

Defined in:
lib/minitest/perf/statistics.rb

Class Method Summary collapse

Class Method Details

.slowest_suitesObject



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/minitest/perf/statistics.rb', line 15

def slowest_suites
  Minitest::Perf.persistence.sql(<<-SQL)
    SELECT suite, AVG(test_count), AVG(avg_total_per_test_run) as avg_total
    FROM (
      SELECT run, suite, COUNT(name) AS test_count, AVG(total) as avg_total_per_test_run
      FROM tests
      GROUP BY run, suite
    ) as temp
    GROUP BY suite
    ORDER BY avg_total desc
    LIMIT 10
  SQL
end

.slowest_testsObject



5
6
7
8
9
10
11
12
13
# File 'lib/minitest/perf/statistics.rb', line 5

def slowest_tests
  Minitest::Perf.persistence.sql(<<-SQL)
    SELECT suite, name, avg(total) as avg_total
    FROM tests
    GROUP BY suite, name
    ORDER BY avg_total DESC
    LIMIT 10
  SQL
end