Class: MockServer::LoadThreshold
- Inherits:
-
Object
- Object
- MockServer::LoadThreshold
- Defined in:
- lib/mockserver/models.rb
Overview
An in-run pass/fail threshold for a load scenario: a per-run metric compared
with comparator against threshold. All thresholds must hold for the run
verdict to be PASS; any breach makes it FAIL. metric is one of
+LATENCY_P50+/+LATENCY_P95+/+LATENCY_P99+/+LATENCY_P999+/+ERROR_RATE+/
THROUGHPUT_RPS; comparator is one of +LESS_THAN+/+LESS_THAN_OR_EQUAL+/
+GREATER_THAN+/+GREATER_THAN_OR_EQUAL+.
Instance Attribute Summary collapse
-
#comparator ⇒ Object
Returns the value of attribute comparator.
-
#metric ⇒ Object
Returns the value of attribute metric.
-
#threshold ⇒ Object
Returns the value of attribute threshold.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(metric:, comparator:, threshold:) ⇒ LoadThreshold
constructor
A new instance of LoadThreshold.
- #to_h ⇒ Object
Constructor Details
#initialize(metric:, comparator:, threshold:) ⇒ LoadThreshold
Returns a new instance of LoadThreshold.
3029 3030 3031 3032 3033 |
# File 'lib/mockserver/models.rb', line 3029 def initialize(metric:, comparator:, threshold:) @metric = metric @comparator = comparator @threshold = threshold end |
Instance Attribute Details
#comparator ⇒ Object
Returns the value of attribute comparator.
3027 3028 3029 |
# File 'lib/mockserver/models.rb', line 3027 def comparator @comparator end |
#metric ⇒ Object
Returns the value of attribute metric.
3027 3028 3029 |
# File 'lib/mockserver/models.rb', line 3027 def metric @metric end |
#threshold ⇒ Object
Returns the value of attribute threshold.
3027 3028 3029 |
# File 'lib/mockserver/models.rb', line 3027 def threshold @threshold end |
Class Method Details
.from_hash(data) ⇒ Object
3043 3044 3045 3046 3047 3048 3049 3050 3051 |
# File 'lib/mockserver/models.rb', line 3043 def self.from_hash(data) return nil if data.nil? new( metric: data['metric'], comparator: data['comparator'], threshold: data['threshold'] ) end |
Instance Method Details
#to_h ⇒ Object
3035 3036 3037 3038 3039 3040 3041 |
# File 'lib/mockserver/models.rb', line 3035 def to_h MockServer.strip_none({ 'metric' => @metric, 'comparator' => @comparator, 'threshold' => @threshold }) end |