Module: UnicornMetrics
- Defined in:
- lib/unicorn_metrics.rb,
lib/unicorn_metrics/version.rb
Defined Under Namespace
Modules: DefaultHttpMetrics, Registry Classes: Counter, Middleware, RequestCounter, RequestTimer, ResponseCounter, Timer
Constant Summary collapse
- VERSION =
"0.2.1"
Class Method Summary collapse
-
.configure {|self| ... } ⇒ Object
Make this class ‘configurable’.
-
.http_metrics=(boolean = false) ⇒ Object
Enable/disable HTTP metrics.
-
.http_metrics? ⇒ Boolean
Used by the middleware to determine whether any HTTP metrics have been defined.
-
.registry ⇒ UnicornMetrics::Registry
Returns the UnicornMetrics::Registry object.
Class Method Details
.configure {|self| ... } ⇒ Object
Make this class ‘configurable’
14 15 16 |
# File 'lib/unicorn_metrics.rb', line 14 def configure yield self end |
.http_metrics=(boolean = false) ⇒ Object
Enable/disable HTTP metrics. Includes defaults
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/unicorn_metrics.rb', line 21 def http_metrics=(boolean=false) return if @_assigned if @http_metrics = boolean registry.extend(UnicornMetrics::DefaultHttpMetrics) registry.register_default_http_counters registry.register_default_http_timers end @_assigned = true end |
.http_metrics? ⇒ Boolean
Used by the middleware to determine whether any HTTP metrics have been defined
35 |
# File 'lib/unicorn_metrics.rb', line 35 def http_metrics? ; @http_metrics ; end |
.registry ⇒ UnicornMetrics::Registry
Returns the UnicornMetrics::Registry object
7 8 9 |
# File 'lib/unicorn_metrics.rb', line 7 def registry UnicornMetrics::Registry end |