Class: Kumonos::Clusters::OutlierDetection

Inherits:
Struct
  • Object
show all
Defined in:
lib/kumonos/clusters.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#base_ejection_time_msObject

Returns the value of attribute base_ejection_time_ms

Returns:

  • (Object)

    the current value of base_ejection_time_ms



82
83
84
# File 'lib/kumonos/clusters.rb', line 82

def base_ejection_time_ms
  @base_ejection_time_ms
end

#consecutive_5xxObject

Returns the value of attribute consecutive_5xx

Returns:

  • (Object)

    the current value of consecutive_5xx



82
83
84
# File 'lib/kumonos/clusters.rb', line 82

def consecutive_5xx
  @consecutive_5xx
end

#consecutive_gateway_failureObject

Returns the value of attribute consecutive_gateway_failure

Returns:

  • (Object)

    the current value of consecutive_gateway_failure



82
83
84
# File 'lib/kumonos/clusters.rb', line 82

def consecutive_gateway_failure
  @consecutive_gateway_failure
end

#enforcing_consecutive_5xxObject

Returns the value of attribute enforcing_consecutive_5xx

Returns:

  • (Object)

    the current value of enforcing_consecutive_5xx



82
83
84
# File 'lib/kumonos/clusters.rb', line 82

def enforcing_consecutive_5xx
  @enforcing_consecutive_5xx
end

#enforcing_consecutive_gateway_failureObject

Returns the value of attribute enforcing_consecutive_gateway_failure

Returns:

  • (Object)

    the current value of enforcing_consecutive_gateway_failure



82
83
84
# File 'lib/kumonos/clusters.rb', line 82

def enforcing_consecutive_gateway_failure
  @enforcing_consecutive_gateway_failure
end

#enforcing_success_rateObject

Returns the value of attribute enforcing_success_rate

Returns:

  • (Object)

    the current value of enforcing_success_rate



82
83
84
# File 'lib/kumonos/clusters.rb', line 82

def enforcing_success_rate
  @enforcing_success_rate
end

#interval_msObject

Returns the value of attribute interval_ms

Returns:

  • (Object)

    the current value of interval_ms



82
83
84
# File 'lib/kumonos/clusters.rb', line 82

def interval_ms
  @interval_ms
end

#max_ejection_percentObject

Returns the value of attribute max_ejection_percent

Returns:

  • (Object)

    the current value of max_ejection_percent



82
83
84
# File 'lib/kumonos/clusters.rb', line 82

def max_ejection_percent
  @max_ejection_percent
end

#success_rate_minimum_hostsObject

Returns the value of attribute success_rate_minimum_hosts

Returns:

  • (Object)

    the current value of success_rate_minimum_hosts



82
83
84
# File 'lib/kumonos/clusters.rb', line 82

def success_rate_minimum_hosts
  @success_rate_minimum_hosts
end

#success_rate_request_volumeObject

Returns the value of attribute success_rate_request_volume

Returns:

  • (Object)

    the current value of success_rate_request_volume



82
83
84
# File 'lib/kumonos/clusters.rb', line 82

def success_rate_request_volume
  @success_rate_request_volume
end

#success_rate_stdev_factorObject

Returns the value of attribute success_rate_stdev_factor

Returns:

  • (Object)

    the current value of success_rate_stdev_factor



82
83
84
# File 'lib/kumonos/clusters.rb', line 82

def success_rate_stdev_factor
  @success_rate_stdev_factor
end

Class Method Details

.build(h) ⇒ Object



86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/kumonos/clusters.rb', line 86

def build(h)
  return nil unless h

  args = []
  %w[consecutive_5xx consecutive_gateway_failure interval_ms base_ejection_time_ms max_ejection_percent
     enforcing_consecutive_5xx enforcing_consecutive_gateway_failure enforcing_success_rate
     success_rate_minimum_hosts success_rate_request_volume success_rate_stdev_factor].each do |e|
    args << h.delete(e)
  end
  raise "Fields are not allowed: #{h.keys}" unless h.keys.empty?

  new(*args)
end

Instance Method Details

#to_hObject



101
102
103
# File 'lib/kumonos/clusters.rb', line 101

def to_h
  super.delete_if { |_, v| v.nil? }
end