Class: Kubevirt::V1StallDetectorOptions

Inherits:
ApiModelBase show all
Defined in:
lib/kubevirt/models/v1_stall_detector_options.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiModelBase

_deserialize, #_to_hash, #to_body, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ V1StallDetectorOptions

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/kubevirt/models/v1_stall_detector_options.rb', line 88

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Kubevirt::V1StallDetectorOptions` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  acceptable_attribute_map = self.class.acceptable_attribute_map
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!acceptable_attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `Kubevirt::V1StallDetectorOptions`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'completion_timeout_factor')
    self.completion_timeout_factor = attributes[:'completion_timeout_factor']
  end

  if attributes.key?(:'ewma_alpha')
    self.ewma_alpha = attributes[:'ewma_alpha']
  end

  if attributes.key?(:'patience_window_decay_factor')
    self.patience_window_decay_factor = attributes[:'patience_window_decay_factor']
  end

  if attributes.key?(:'precopy_possible_factor')
    self.precopy_possible_factor = attributes[:'precopy_possible_factor']
  end

  if attributes.key?(:'search_local_minima')
    self.search_local_minima = attributes[:'search_local_minima']
  end

  if attributes.key?(:'stall_margin')
    self.stall_margin = attributes[:'stall_margin']
  end

  if attributes.key?(:'stall_progress_timeout')
    self.stall_progress_timeout = attributes[:'stall_progress_timeout']
  end

  if attributes.key?(:'switchover_timeout')
    self.switchover_timeout = attributes[:'switchover_timeout']
  end
end

Instance Attribute Details

#completion_timeout_factorObject

CompletionTimeoutFactor multiplies the computed migration completion timeout to determine the total time budget for deciding whether a forced switchover can still finish in time, and to extend the abort deadline after initiating a completion-timeout-driven switchover. Defaults to "2".



19
20
21
# File 'lib/kubevirt/models/v1_stall_detector_options.rb', line 19

def completion_timeout_factor
  @completion_timeout_factor
end

#ewma_alphaObject

EwmaAlpha is the smoothing factor for the exponentially weighted moving average of observed migration bandwidth. Must be in the range (0, 1]; zero is invalid because the estimate would never incorporate new samples. Higher values weight recent samples more heavily. Defaults to "0.4".



22
23
24
# File 'lib/kubevirt/models/v1_stall_detector_options.rb', line 22

def ewma_alpha
  @ewma_alpha
end

#patience_window_decay_factorObject

PatienceWindowDecayFactor is the factor by which the relaxation patience window is multiplied after each best-remaining-bytes relaxation step. Defaults to "0.5".



25
26
27
# File 'lib/kubevirt/models/v1_stall_detector_options.rb', line 25

def patience_window_decay_factor
  @patience_window_decay_factor
end

#precopy_possible_factorObject

PrecopyPossibleFactor is the maximum factor by which estimated downtime may exceed MaxDowntime while still attempting a soft stop-and-copy instead of aborting the migration. Defaults to "1.5".



28
29
30
# File 'lib/kubevirt/models/v1_stall_detector_options.rb', line 28

def precopy_possible_factor
  @precopy_possible_factor
end

#search_local_minimaObject

SearchLocalMinima controls whether convergence actions are delayed until remaining bytes reach a local minimum near the best observed value. When false, actions may trigger as soon as a stall is detected. Defaults to true.



31
32
33
# File 'lib/kubevirt/models/v1_stall_detector_options.rb', line 31

def search_local_minima
  @search_local_minima
end

#stall_marginObject

StallMargin is the fractional tolerance, expressed as a percentage, used when comparing remaining migration bytes against the best observed value to detect stalls and local minima. A stall is reported when remaining bytes stay above (1 - StallMargin/100) of the outside-window minimum. Defaults to 4.



34
35
36
# File 'lib/kubevirt/models/v1_stall_detector_options.rb', line 34

def stall_margin
  @stall_margin
end

#stall_progress_timeoutObject

StallProgressTimeout is the duration in seconds of the sliding window used to track minimum remaining-bytes and detect when migration progress has stalled. Defaults to 40.



37
38
39
# File 'lib/kubevirt/models/v1_stall_detector_options.rb', line 37

def stall_progress_timeout
  @stall_progress_timeout
end

#switchover_timeoutObject

SwitchoverTimeout is the duration in seconds allowed for a stop-and-copy or post-copy switchover to complete after being triggered before the migration is aborted. Defaults to 60.



40
41
42
# File 'lib/kubevirt/models/v1_stall_detector_options.rb', line 40

def switchover_timeout
  @switchover_timeout
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



57
58
59
# File 'lib/kubevirt/models/v1_stall_detector_options.rb', line 57

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



62
63
64
# File 'lib/kubevirt/models/v1_stall_detector_options.rb', line 62

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/kubevirt/models/v1_stall_detector_options.rb', line 43

def self.attribute_map
  {
    :'completion_timeout_factor' => :'completionTimeoutFactor',
    :'ewma_alpha' => :'ewmaAlpha',
    :'patience_window_decay_factor' => :'patienceWindowDecayFactor',
    :'precopy_possible_factor' => :'precopyPossibleFactor',
    :'search_local_minima' => :'searchLocalMinima',
    :'stall_margin' => :'stallMargin',
    :'stall_progress_timeout' => :'stallProgressTimeout',
    :'switchover_timeout' => :'switchoverTimeout'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# File 'lib/kubevirt/models/v1_stall_detector_options.rb', line 180

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



81
82
83
84
# File 'lib/kubevirt/models/v1_stall_detector_options.rb', line 81

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/kubevirt/models/v1_stall_detector_options.rb', line 67

def self.openapi_types
  {
    :'completion_timeout_factor' => :'String',
    :'ewma_alpha' => :'String',
    :'patience_window_decay_factor' => :'String',
    :'precopy_possible_factor' => :'String',
    :'search_local_minima' => :'Boolean',
    :'stall_margin' => :'Integer',
    :'stall_progress_timeout' => :'Integer',
    :'switchover_timeout' => :'Integer'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/kubevirt/models/v1_stall_detector_options.rb', line 152

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      completion_timeout_factor == o.completion_timeout_factor &&
      ewma_alpha == o.ewma_alpha &&
      patience_window_decay_factor == o.patience_window_decay_factor &&
      precopy_possible_factor == o.precopy_possible_factor &&
      search_local_minima == o.search_local_minima &&
      stall_margin == o.stall_margin &&
      stall_progress_timeout == o.stall_progress_timeout &&
      switchover_timeout == o.switchover_timeout
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


167
168
169
# File 'lib/kubevirt/models/v1_stall_detector_options.rb', line 167

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



173
174
175
# File 'lib/kubevirt/models/v1_stall_detector_options.rb', line 173

def hash
  [completion_timeout_factor, ewma_alpha, patience_window_decay_factor, precopy_possible_factor, search_local_minima, stall_margin, stall_progress_timeout, switchover_timeout].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



137
138
139
140
141
# File 'lib/kubevirt/models/v1_stall_detector_options.rb', line 137

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



202
203
204
205
206
207
208
209
210
211
212
213
214
# File 'lib/kubevirt/models/v1_stall_detector_options.rb', line 202

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



145
146
147
148
# File 'lib/kubevirt/models/v1_stall_detector_options.rb', line 145

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  true
end