Class: Airbrake::TDigest::Centroid Private
- Inherits:
-
Object
- Object
- Airbrake::TDigest::Centroid
- Defined in:
- lib/airbrake-ruby/tdigest.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Centroid represents a number of data points.
Instance Attribute Summary collapse
- #cumn ⇒ Object private
- #mean ⇒ Object private
- #mean_cumn ⇒ Object private
- #n ⇒ Object private
Instance Method Summary collapse
- #as_json(_ = nil) ⇒ Object private
-
#initialize(mean, n, cumn, mean_cumn = nil) ⇒ Centroid
constructor
private
A new instance of Centroid.
Constructor Details
#initialize(mean, n, cumn, mean_cumn = nil) ⇒ Centroid
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Centroid.
28 29 30 31 32 33 |
# File 'lib/airbrake-ruby/tdigest.rb', line 28 def initialize(mean, n, cumn, mean_cumn = nil) @mean = mean @n = n @cumn = cumn @mean_cumn = mean_cumn end |
Instance Attribute Details
#cumn ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
26 27 28 |
# File 'lib/airbrake-ruby/tdigest.rb', line 26 def cumn @cumn end |
#mean ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
26 27 28 |
# File 'lib/airbrake-ruby/tdigest.rb', line 26 def mean @mean end |
#mean_cumn ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
26 27 28 |
# File 'lib/airbrake-ruby/tdigest.rb', line 26 def mean_cumn @mean_cumn end |
#n ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
26 27 28 |
# File 'lib/airbrake-ruby/tdigest.rb', line 26 def n @n end |
Instance Method Details
#as_json(_ = nil) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
35 36 37 |
# File 'lib/airbrake-ruby/tdigest.rb', line 35 def as_json(_ = nil) { m: mean, n: n } end |