Module: RailsPulse::HasPerformanceStatus
- Extended by:
- ActiveSupport::Concern
- Defined in:
- app/models/concerns/rails_pulse/has_performance_status.rb
Instance Method Summary collapse
-
#performance_status ⇒ Symbol
Returns performance status based on configured thresholds.
Instance Method Details
#performance_status ⇒ Symbol
Returns performance status based on configured thresholds
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'app/models/concerns/rails_pulse/has_performance_status.rb', line 19 def performance_status thresholds = RailsPulse.configuration.job_thresholds attr_name = self.class.get_performance_status_attribute duration_value = public_send(attr_name).to_f if duration_value < thresholds[:slow] :fast elsif duration_value < thresholds[:very_slow] :slow elsif duration_value < thresholds[:critical] :very_slow else :critical end end |