Class: RailsPulse::Dashboard::HealthSummary

Inherits:
Object
  • Object
show all
Includes:
Concerns::ThresholdConstants, Concerns::TimeRangeHelper
Defined in:
app/models/rails_pulse/dashboard/health_summary.rb

Constant Summary

Constants included from Concerns::ThresholdConstants

Concerns::ThresholdConstants::CRITICAL_ERROR_RATE, Concerns::ThresholdConstants::CRITICAL_JOB_FAILURE_RATE, Concerns::ThresholdConstants::WARNING_ERROR_RATE, Concerns::ThresholdConstants::WARNING_JOB_FAILURE_RATE

Instance Method Summary collapse

Constructor Details

#initialize(disabled_tags: [], show_non_tagged: true, period: 7) ⇒ HealthSummary

Returns a new instance of HealthSummary.



7
8
9
10
11
12
13
14
# File 'app/models/rails_pulse/dashboard/health_summary.rb', line 7

def initialize(disabled_tags: [], show_non_tagged: true, period: 7)
  @disabled_tags   = disabled_tags
  @show_non_tagged = show_non_tagged
  @period          = period
  @route_thresholds = RailsPulse.configuration.route_thresholds
  @query_thresholds = RailsPulse.configuration.query_thresholds
  @job_thresholds   = RailsPulse.configuration.job_thresholds
end

Instance Method Details

#to_health_dataObject



16
17
18
19
20
21
22
23
# File 'app/models/rails_pulse/dashboard/health_summary.rb', line 16

def to_health_data
  {
    routes:   route_counts,
    queries:  query_counts,
    jobs:     job_counts,
    storage:  storage_counts
  }
end