Module: Traxor::Faraday
- Defined in:
- lib/traxor/faraday.rb
Constant Summary collapse
- DURATION_METRIC =
'faraday.request.duration'
- COUNT_METRIC =
'faraday.request.count'
Class Method Summary collapse
Class Method Details
.record(event) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/traxor/faraday.rb', line 10 def self.record(event) url = event.payload[:url] duration = (event.duration || 0.0).to_f = { faraday_host: url.host, faraday_method: event.payload[:method] } Metric.count COUNT_METRIC, 1, Metric.measure DURATION_METRIC, "#{duration.round(2)}ms", if duration.positive? end |