Class: Watchdog::Dashboard::DashboardController

Inherits:
ApplicationController show all
Includes:
FlakyStats, MetricStats
Defined in:
app/controllers/watchdog/dashboard/dashboard_controller.rb

Instance Method Summary collapse

Methods included from FlakyStats

#flaky_average_time, #flaky_avg_execution_time_by_file, #flaky_execution_time_variance, #flaky_failed_tests, #flaky_failed_tests_trend_by_file, #flaky_fastest_test, #flaky_longest_tests_by_day, #flaky_percentiles, #flaky_performance_trend, #flaky_run_time_distribution, #flaky_slowest_test, #flaky_stability_trend, #flaky_temporal_complexity_analysis, #flaky_test_count_trend, #flaky_test_dependency_analysis, #flaky_test_stability_analysis, #flaky_tests_exceeding_time_threshold, #flaky_tests_grouped_by_file, #flaky_tests_that_took_longer_than, #flaky_time_distribution_analysis, #flaky_total_execution_time_by_day

Methods included from MetricStats

#average_time, #avg_execution_time_by_file, #execution_time_variance, #failed_tests, #failed_tests_trend_by_file, #fastest_test, #longest_tests_by_day, #percentiles, #performance_trend, #run_time_distribution, #slowest_test, #stability_trend, #temporal_complexity_analysis, #test_count_trend, #test_dependency_analysis, #test_stability_analysis, #tests_exceeding_time_threshold, #tests_grouped_by_file, #tests_that_took_longer_than, #time_distribution_analysis, #total_execution_time_by_day

Instance Method Details

#flakiesObject



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'app/controllers/watchdog/dashboard/dashboard_controller.rb', line 47

def flakies
  return redirect_to root_path if Metric.count.zero?

  @metrics = Metric.all
  @average_time = flaky_average_time
  @fastest_test = flaky_fastest_test
  @slowest_test = flaky_slowest_test
  @percentiles = flaky_percentiles
  @failed_tests = flaky_failed_tests
  @tests_grouped_by_file = flaky_tests_grouped_by_file
  @tests_that_took_longer_than = flaky_tests_that_took_longer_than(0.5)
  @time_distribution_analysis = flaky_time_distribution_analysis

  @test_stability_analysis = flaky_test_stability_analysis
  @total_tests = @test_stability_analysis[:total_tests]
  @passed_percentage = @test_stability_analysis[:passed_percentage]
  @failed_percentage = @test_stability_analysis[:failed_percentage]
  @pending_percentage = @test_stability_analysis[:pending_percentage]

  @execution_time_variance = flaky_execution_time_variance
  @temporal_complexity_analysis = flaky_temporal_complexity_analysis
  @test_dependency_analysis = flaky_test_dependency_analysis
end

#historicObject



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/controllers/watchdog/dashboard/dashboard_controller.rb', line 9

def historic
  @metrics = Metric.all

  @run_time_distribution = run_time_distribution
  @performance_trend = performance_trend
  @test_count_trend = test_count_trend
  @longest_tests_by_day = longest_tests_by_day
  @total_execution_time_by_day = total_execution_time_by_day
  @tests_exceeding_time_threshold = tests_exceeding_time_threshold
  @failed_tests_trend_by_file = failed_tests_trend_by_file
  @avg_execution_time_by_file = avg_execution_time_by_file
  @stability_trend = stability_trend
end

#indexObject



6
7
# File 'app/controllers/watchdog/dashboard/dashboard_controller.rb', line 6

def index
end

#metricsObject



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'app/controllers/watchdog/dashboard/dashboard_controller.rb', line 23

def metrics
  return redirect_to root_path if Metric.count.zero?

  @metrics = Metric.all
  @average_time = average_time
  @fastest_test = fastest_test
  @slowest_test = slowest_test
  @percentiles = percentiles
  @failed_tests = failed_tests
  @tests_grouped_by_file = tests_grouped_by_file
  @tests_that_took_longer_than = tests_that_took_longer_than(0.5)
  @time_distribution_analysis = time_distribution_analysis

  @test_stability_analysis = test_stability_analysis
  @total_tests = @test_stability_analysis[:total_tests]
  @passed_percentage = @test_stability_analysis[:passed_percentage]
  @failed_percentage = @test_stability_analysis[:failed_percentage]
  @pending_percentage = @test_stability_analysis[:pending_percentage]

  @execution_time_variance = execution_time_variance
  @temporal_complexity_analysis = temporal_complexity_analysis
  @test_dependency_analysis = test_dependency_analysis
end