Class: Leafy::Instrumented::CollectedInstrumented

Inherits:
BasicInstrumented show all
Defined in:
lib/leafy/instrumented/collected_instrumented.rb

Constant Summary collapse

INFO =
1
SUCCESS =
2
REDIRECT =
3
CLIENT =
4
SERVER =
5

Constants inherited from BasicInstrumented

BasicInstrumented::NAME_PREFIX

Instance Method Summary collapse

Methods inherited from BasicInstrumented

#call

Constructor Details

#initialize(registry, name) ⇒ CollectedInstrumented

creates the some metrics for status code 2xx, 3xx, 4xx and 5xx. all none registered status codes are marked on the meter named ‘other’.

Parameters:

  • the (Leafy::Metrics::Registry)

    registry on which register the metrics

  • name (String)

    basename of the metrics



17
18
19
20
21
22
23
# File 'lib/leafy/instrumented/collected_instrumented.rb', line 17

def initialize( registry, name )
  super( registry, name,
         { SUCCESS => "#{NAME_PREFIX}.2xx",
           REDIRECT => "#{NAME_PREFIX}.3xx",
           CLIENT => "#{NAME_PREFIX}.4xx",
           SERVER => "#{NAME_PREFIX}.5xx" } )
end

Instance Method Details

#mark_meter_for_status_code(status) ⇒ Object



25
26
27
# File 'lib/leafy/instrumented/collected_instrumented.rb', line 25

def mark_meter_for_status_code( status )
  super( status/ 100 )
end