Class: Watchdog::Dashboard::MetricsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/watchdog/dashboard/metrics_controller.rb

Instance Method Summary collapse

Instance Method Details

#analyticsObject



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

def analytics
  batch = params[:metrics]

  metrics_to_insert = batch.map do |metric|
    Metric.create!(
      description: metric[:description],
      file_path: metric[:file_path],
      location: metric[:location],
      run_time: metric[:run_time],
      status: metric[:status],
      error_message: metric[:error_message],
      flaky: metric[:flaky]
    )
  end
end