Class: SqlReporter::Difference
- Inherits:
-
Object
- Object
- SqlReporter::Difference
- Defined in:
- lib/sql_reporter/difference.rb
Overview
Difference between 2 Query objects
Instance Attribute Summary collapse
-
#feature ⇒ Object
readonly
Returns the value of attribute feature.
-
#master ⇒ Object
readonly
Returns the value of attribute master.
-
#query_name ⇒ Object
readonly
Returns the value of attribute query_name.
Instance Method Summary collapse
- #delta_cached_count ⇒ Object
- #delta_count ⇒ Object
- #delta_time ⇒ Object
-
#initialize(name, master, feature) ⇒ Difference
constructor
A new instance of Difference.
- #sort_score(max_count) ⇒ Object
Constructor Details
#initialize(name, master, feature) ⇒ Difference
Returns a new instance of Difference.
6 7 8 9 10 |
# File 'lib/sql_reporter/difference.rb', line 6 def initialize(name, master, feature) @query_name = name @master = master @feature = feature end |
Instance Attribute Details
#feature ⇒ Object (readonly)
Returns the value of attribute feature.
4 5 6 |
# File 'lib/sql_reporter/difference.rb', line 4 def feature @feature end |
#master ⇒ Object (readonly)
Returns the value of attribute master.
4 5 6 |
# File 'lib/sql_reporter/difference.rb', line 4 def master @master end |
#query_name ⇒ Object (readonly)
Returns the value of attribute query_name.
4 5 6 |
# File 'lib/sql_reporter/difference.rb', line 4 def query_name @query_name end |
Instance Method Details
#delta_cached_count ⇒ Object
16 17 18 |
# File 'lib/sql_reporter/difference.rb', line 16 def delta_cached_count (feature - master).cached_count end |
#delta_count ⇒ Object
12 13 14 |
# File 'lib/sql_reporter/difference.rb', line 12 def delta_count (feature - master).count end |
#delta_time ⇒ Object
20 21 22 |
# File 'lib/sql_reporter/difference.rb', line 20 def delta_time (feature - master).duration_formatted end |
#sort_score(max_count) ⇒ Object
24 25 26 |
# File 'lib/sql_reporter/difference.rb', line 24 def sort_score(max_count) (master - feature).count.abs + master.post_decimal_score(max_count) end |