Class: Sentry::Metrics::DistributionMetric
- Defined in:
- lib/sentry/metrics/distribution_metric.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #add(value) ⇒ Object
-
#initialize(value) ⇒ DistributionMetric
constructor
A new instance of DistributionMetric.
- #serialize ⇒ Object
- #weight ⇒ Object
Constructor Details
#initialize(value) ⇒ DistributionMetric
Returns a new instance of DistributionMetric.
8 9 10 |
# File 'lib/sentry/metrics/distribution_metric.rb', line 8 def initialize(value) @value = [value.to_f] end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
6 7 8 |
# File 'lib/sentry/metrics/distribution_metric.rb', line 6 def value @value end |
Instance Method Details
#add(value) ⇒ Object
12 13 14 |
# File 'lib/sentry/metrics/distribution_metric.rb', line 12 def add(value) @value << value.to_f end |
#serialize ⇒ Object
16 17 18 |
# File 'lib/sentry/metrics/distribution_metric.rb', line 16 def serialize value end |
#weight ⇒ Object
20 21 22 |
# File 'lib/sentry/metrics/distribution_metric.rb', line 20 def weight value.size end |