Class: Airbrake::TDigest::Centroid Private

Inherits:
Object
  • Object
show all
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.

Since:

  • v3.2.0

Instance Attribute Summary collapse

Instance Method Summary collapse

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.

Since:

  • v3.2.0



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

#cumnObject

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.

Since:

  • v3.2.0



26
27
28
# File 'lib/airbrake-ruby/tdigest.rb', line 26

def cumn
  @cumn
end

#meanObject

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.

Since:

  • v3.2.0



26
27
28
# File 'lib/airbrake-ruby/tdigest.rb', line 26

def mean
  @mean
end

#mean_cumnObject

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.

Since:

  • v3.2.0



26
27
28
# File 'lib/airbrake-ruby/tdigest.rb', line 26

def mean_cumn
  @mean_cumn
end

#nObject

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.

Since:

  • v3.2.0



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.

Since:

  • v3.2.0



35
36
37
# File 'lib/airbrake-ruby/tdigest.rb', line 35

def as_json(_ = nil)
  { m: mean, n: n }
end