Module: Sentry::Metrics
- Defined in:
- lib/sentry/metrics.rb
Class Method Summary collapse
-
.count(name, value: 1, attributes: nil, integration: nil) ⇒ void
Increments a counter metric.
-
.distribution(name, value, unit: nil, attributes: nil, integration: nil) ⇒ void
Records a distribution metric.
-
.gauge(name, value, unit: nil, attributes: nil, integration: nil) ⇒ void
Records a gauge metric.
Class Method Details
.count(name, value: 1, attributes: nil, integration: nil) ⇒ void
This method returns an undefined value.
Increments a counter metric
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/sentry/metrics.rb', line 14 def count(name, value: 1, attributes: nil, integration: nil) return unless Sentry.initialized? Sentry.get_current_hub.capture_metric( name: name, type: :counter, value: value, attributes: attributes, integration: integration ) end |
.distribution(name, value, unit: nil, attributes: nil, integration: nil) ⇒ void
This method returns an undefined value.
Records a distribution metric
53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/sentry/metrics.rb', line 53 def distribution(name, value, unit: nil, attributes: nil, integration: nil) return unless Sentry.initialized? Sentry.get_current_hub.capture_metric( name: name, type: :distribution, value: value, unit: unit, attributes: attributes, integration: integration ) end |
.gauge(name, value, unit: nil, attributes: nil, integration: nil) ⇒ void
This method returns an undefined value.
Records a gauge metric
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/sentry/metrics.rb', line 33 def gauge(name, value, unit: nil, attributes: nil, integration: nil) return unless Sentry.initialized? Sentry.get_current_hub.capture_metric( name: name, type: :gauge, value: value, unit: unit, attributes: attributes, integration: integration ) end |