Class: CloseYourIt::Performance::Rollup
- Inherits:
-
Object
- Object
- CloseYourIt::Performance::Rollup
- Defined in:
- lib/closeyourit/performance/rollup.rb
Overview
Trasforma un RequestProfile (+ durata/route della richiesta) in 0..N verdetti PerformanceIssueEvent. Le soglie vivono nella Configuration. Detection lato client; dedup/alert lato backend.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(profile:, configuration:, route: nil, request_duration_ms: nil, trace_id: nil) ⇒ Rollup
constructor
A new instance of Rollup.
Constructor Details
#initialize(profile:, configuration:, route: nil, request_duration_ms: nil, trace_id: nil) ⇒ Rollup
Returns a new instance of Rollup.
12 13 14 15 16 17 18 |
# File 'lib/closeyourit/performance/rollup.rb', line 12 def initialize(profile:, configuration:, route: nil, request_duration_ms: nil, trace_id: nil) @profile = profile @config = configuration @route = route @request_duration_ms = request_duration_ms @trace_id = trace_id end |
Class Method Details
.call ⇒ Object
10 |
# File 'lib/closeyourit/performance/rollup.rb', line 10 def self.call(...) = new(...).call |
Instance Method Details
#call ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/closeyourit/performance/rollup.rb', line 20 def call events = [] events.concat(n_plus_one_events) events << high_query_count_event if high_query_count? events << slow_request_event if slow_request? events.concat(slow_external_events) events.compact end |