Class: GroongaQueryLog::Command::CheckPerformanceRegression::Threshold
- Inherits:
-
Object
- Object
- GroongaQueryLog::Command::CheckPerformanceRegression::Threshold
- Defined in:
- lib/groonga-query-log/command/check-performance-regression.rb
Instance Attribute Summary collapse
-
#operation_ratio ⇒ Object
Returns the value of attribute operation_ratio.
-
#operation_second ⇒ Object
Returns the value of attribute operation_second.
-
#query_ratio ⇒ Object
Returns the value of attribute query_ratio.
-
#query_second ⇒ Object
Returns the value of attribute query_second.
Instance Method Summary collapse
-
#initialize ⇒ Threshold
constructor
A new instance of Threshold.
- #slow_operation?(diff_sec, diff_ratio) ⇒ Boolean
- #slow_query?(diff_sec, diff_ratio) ⇒ Boolean
Constructor Details
#initialize ⇒ Threshold
Returns a new instance of Threshold.
193 194 195 196 197 198 |
# File 'lib/groonga-query-log/command/check-performance-regression.rb', line 193 def initialize @query_ratio = 0 @query_second = 0.2 @operation_ratio = 0.1 @operation_second = 0.1 end |
Instance Attribute Details
#operation_ratio ⇒ Object
Returns the value of attribute operation_ratio.
191 192 193 |
# File 'lib/groonga-query-log/command/check-performance-regression.rb', line 191 def operation_ratio @operation_ratio end |
#operation_second ⇒ Object
Returns the value of attribute operation_second.
192 193 194 |
# File 'lib/groonga-query-log/command/check-performance-regression.rb', line 192 def operation_second @operation_second end |
#query_ratio ⇒ Object
Returns the value of attribute query_ratio.
189 190 191 |
# File 'lib/groonga-query-log/command/check-performance-regression.rb', line 189 def query_ratio @query_ratio end |
#query_second ⇒ Object
Returns the value of attribute query_second.
190 191 192 |
# File 'lib/groonga-query-log/command/check-performance-regression.rb', line 190 def query_second @query_second end |
Instance Method Details
#slow_operation?(diff_sec, diff_ratio) ⇒ Boolean
206 207 208 209 210 |
# File 'lib/groonga-query-log/command/check-performance-regression.rb', line 206 def slow_operation?(diff_sec, diff_ratio) return false if diff_sec.zero? (diff_sec >= @operation_second) and (diff_ratio >= @operation_ratio) end |
#slow_query?(diff_sec, diff_ratio) ⇒ Boolean
200 201 202 203 204 |
# File 'lib/groonga-query-log/command/check-performance-regression.rb', line 200 def slow_query?(diff_sec, diff_ratio) return false if diff_sec.zero? (diff_sec >= @query_second) and (diff_ratio >= @query_ratio) end |