Class: OCI::ApmConfig::Models::Apdex

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/apm_config/models/apdex.rb

Overview

An Apdex configuration rule. The Apdex score is computed based on how the response time of a span compares to two predefined threshold values. The first threshold defines the maximum response time that is considered satisfactory for the end user. The second one defines the maximum response time that is considered tolerable. All times larger than that will be considered frustrating for the end user. An Apdex configuration rule works by selecting a subset of spans based on a filter expression and applying the two threshold comparisons to compute a score for each of the selected spans. The rule has an "isApplyToErrorSpans" property that controls whether or not to compute the Apdex for spans that have been marked as errors. If this property is set to "true", then the Apdex score for error spans is computed in the same way as for non-error ones. If set to "false", then computation for error spans is skipped, and the score is set to "frustrating" regardless of the configured thresholds. The default is "false". The "isEnabled" property controls whether or not an Apdex score is computed and can be used to disable Apdex score for certain spans. The default is "true". The "priority" property specifies the importance of the rule within a rule set. Lower values indicate a higher priority. Rules with higher priorities are evaluated first in the rule set. The priority of the rules must be unique within a rule set.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Apdex

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :filter_text (String)

    The value to assign to the #filter_text property

  • :priority (Integer)

    The value to assign to the #priority property

  • :is_enabled (BOOLEAN)

    The value to assign to the #is_enabled property

  • :satisfied_response_time (Integer)

    The value to assign to the #satisfied_response_time property

  • :tolerating_response_time (Integer)

    The value to assign to the #tolerating_response_time property

  • :is_apply_to_error_spans (BOOLEAN)

    The value to assign to the #is_apply_to_error_spans property

  • :display_name (String)

    The value to assign to the #display_name property



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/oci/apm_config/models/apdex.rb', line 111

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.filter_text = attributes[:'filterText'] if attributes[:'filterText']

  raise 'You cannot provide both :filterText and :filter_text' if attributes.key?(:'filterText') && attributes.key?(:'filter_text')

  self.filter_text = attributes[:'filter_text'] if attributes[:'filter_text']

  self.priority = attributes[:'priority'] if attributes[:'priority']

  self.is_enabled = attributes[:'isEnabled'] unless attributes[:'isEnabled'].nil?
  self.is_enabled = true if is_enabled.nil? && !attributes.key?(:'isEnabled') # rubocop:disable Style/StringLiterals

  raise 'You cannot provide both :isEnabled and :is_enabled' if attributes.key?(:'isEnabled') && attributes.key?(:'is_enabled')

  self.is_enabled = attributes[:'is_enabled'] unless attributes[:'is_enabled'].nil?
  self.is_enabled = true if is_enabled.nil? && !attributes.key?(:'isEnabled') && !attributes.key?(:'is_enabled') # rubocop:disable Style/StringLiterals

  self.satisfied_response_time = attributes[:'satisfiedResponseTime'] if attributes[:'satisfiedResponseTime']

  raise 'You cannot provide both :satisfiedResponseTime and :satisfied_response_time' if attributes.key?(:'satisfiedResponseTime') && attributes.key?(:'satisfied_response_time')

  self.satisfied_response_time = attributes[:'satisfied_response_time'] if attributes[:'satisfied_response_time']

  self.tolerating_response_time = attributes[:'toleratingResponseTime'] if attributes[:'toleratingResponseTime']

  raise 'You cannot provide both :toleratingResponseTime and :tolerating_response_time' if attributes.key?(:'toleratingResponseTime') && attributes.key?(:'tolerating_response_time')

  self.tolerating_response_time = attributes[:'tolerating_response_time'] if attributes[:'tolerating_response_time']

  self.is_apply_to_error_spans = attributes[:'isApplyToErrorSpans'] unless attributes[:'isApplyToErrorSpans'].nil?
  self.is_apply_to_error_spans = false if is_apply_to_error_spans.nil? && !attributes.key?(:'isApplyToErrorSpans') # rubocop:disable Style/StringLiterals

  raise 'You cannot provide both :isApplyToErrorSpans and :is_apply_to_error_spans' if attributes.key?(:'isApplyToErrorSpans') && attributes.key?(:'is_apply_to_error_spans')

  self.is_apply_to_error_spans = attributes[:'is_apply_to_error_spans'] unless attributes[:'is_apply_to_error_spans'].nil?
  self.is_apply_to_error_spans = false if is_apply_to_error_spans.nil? && !attributes.key?(:'isApplyToErrorSpans') && !attributes.key?(:'is_apply_to_error_spans') # rubocop:disable Style/StringLiterals

  self.display_name = attributes[:'displayName'] if attributes[:'displayName']

  raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')

  self.display_name = attributes[:'display_name'] if attributes[:'display_name']
end

Instance Attribute Details

#display_nameString

The name by which a configuration entity is displayed to the end user.

Returns:

  • (String)


66
67
68
# File 'lib/oci/apm_config/models/apdex.rb', line 66

def display_name
  @display_name
end

#filter_textString

[Required] The string that defines the Span Filter expression.

Returns:

  • (String)


30
31
32
# File 'lib/oci/apm_config/models/apdex.rb', line 30

def filter_text
  @filter_text
end

#is_apply_to_error_spansBOOLEAN

Specifies whether an Apdex score should be computed for error spans. Setting it to "true" means that the Apdex score is computed in the usual way. Setting it to "false" skips the Apdex computation and sets the Apdex score to "frustrating" regardless of the configured thresholds. The default is "false".

Returns:

  • (BOOLEAN)


62
63
64
# File 'lib/oci/apm_config/models/apdex.rb', line 62

def is_apply_to_error_spans
  @is_apply_to_error_spans
end

#is_enabledBOOLEAN

Specifies whether the Apdex score should be computed for spans matching the rule. This can be used to disable Apdex score for spans that do not need or require it. The default is "true".

Returns:

  • (BOOLEAN)


43
44
45
# File 'lib/oci/apm_config/models/apdex.rb', line 43

def is_enabled
  @is_enabled
end

#priorityInteger

[Required] The priority controls the order in which multiple rules in a rule set are applied. Lower values indicate higher priorities. Rules with higher priority are applied first, and once a match is found, the rest of the rules are ignored. Rules within the same rule set cannot have the same priority.

Returns:

  • (Integer)


37
38
39
# File 'lib/oci/apm_config/models/apdex.rb', line 37

def priority
  @priority
end

#satisfied_response_timeInteger

The maximum response time in milliseconds that is considered "satisfactory" for the end user.

Returns:

  • (Integer)


48
49
50
# File 'lib/oci/apm_config/models/apdex.rb', line 48

def satisfied_response_time
  @satisfied_response_time
end

#tolerating_response_timeInteger

The maximum response time in milliseconds that is considered "tolerable" for the end user. A response time beyond this threshold is considered "frustrating". This value cannot be lower than "satisfiedResponseTime".

Returns:

  • (Integer)


55
56
57
# File 'lib/oci/apm_config/models/apdex.rb', line 55

def tolerating_response_time
  @tolerating_response_time
end

Class Method Details

.attribute_mapObject

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



69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/oci/apm_config/models/apdex.rb', line 69

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'filter_text': :'filterText',
    'priority': :'priority',
    'is_enabled': :'isEnabled',
    'satisfied_response_time': :'satisfiedResponseTime',
    'tolerating_response_time': :'toleratingResponseTime',
    'is_apply_to_error_spans': :'isApplyToErrorSpans',
    'display_name': :'displayName'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/oci/apm_config/models/apdex.rb', line 84

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'filter_text': :'String',
    'priority': :'Integer',
    'is_enabled': :'BOOLEAN',
    'satisfied_response_time': :'Integer',
    'tolerating_response_time': :'Integer',
    'is_apply_to_error_spans': :'BOOLEAN',
    'display_name': :'String'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



167
168
169
170
171
172
173
174
175
176
177
178
# File 'lib/oci/apm_config/models/apdex.rb', line 167

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    filter_text == other.filter_text &&
    priority == other.priority &&
    is_enabled == other.is_enabled &&
    satisfied_response_time == other.satisfied_response_time &&
    tolerating_response_time == other.tolerating_response_time &&
    is_apply_to_error_spans == other.is_apply_to_error_spans &&
    display_name == other.display_name
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



203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# File 'lib/oci/apm_config/models/apdex.rb', line 203

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      public_method("#{key}=").call(
        OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
      )
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


183
184
185
# File 'lib/oci/apm_config/models/apdex.rb', line 183

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



192
193
194
# File 'lib/oci/apm_config/models/apdex.rb', line 192

def hash
  [filter_text, priority, is_enabled, satisfied_response_time, tolerating_response_time, is_apply_to_error_spans, display_name].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



236
237
238
239
240
241
242
243
244
245
# File 'lib/oci/apm_config/models/apdex.rb', line 236

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")

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

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



230
231
232
# File 'lib/oci/apm_config/models/apdex.rb', line 230

def to_s
  to_hash.to_s
end