Class: Hashira::Hotspots::FileCost
- Inherits:
-
Data
- Object
- Data
- Hashira::Hotspots::FileCost
- Defined in:
- lib/hashira/hotspots/file_cost.rb
Instance Attribute Summary collapse
-
#churn ⇒ Object
readonly
Returns the value of attribute churn.
-
#cognitive ⇒ Object
readonly
Returns the value of attribute cognitive.
-
#duplication ⇒ Object
readonly
Returns the value of attribute duplication.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
Instance Method Summary collapse
Instance Attribute Details
#churn ⇒ Object (readonly)
Returns the value of attribute churn
7 8 9 |
# File 'lib/hashira/hotspots/file_cost.rb', line 7 def churn @churn end |
#cognitive ⇒ Object (readonly)
Returns the value of attribute cognitive
7 8 9 |
# File 'lib/hashira/hotspots/file_cost.rb', line 7 def cognitive @cognitive end |
#duplication ⇒ Object (readonly)
Returns the value of attribute duplication
7 8 9 |
# File 'lib/hashira/hotspots/file_cost.rb', line 7 def duplication @duplication end |
#file ⇒ Object (readonly)
Returns the value of attribute file
7 8 9 |
# File 'lib/hashira/hotspots/file_cost.rb', line 7 def file @file end |
Instance Method Details
#cells ⇒ Object
17 |
# File 'lib/hashira/hotspots/file_cost.rb', line 17 def cells = [file, cognitive, duplication, churn, rank] |
#cost ⇒ Object
9 |
# File 'lib/hashira/hotspots/file_cost.rb', line 9 def cost = cognitive + duplication |
#heat ⇒ Object
13 |
# File 'lib/hashira/hotspots/file_cost.rb', line 13 def heat = [churn, CHURN_FLOOR].max |
#rank ⇒ Object
11 |
# File 'lib/hashira/hotspots/file_cost.rb', line 11 def rank = cost * heat |
#to_h ⇒ Object
15 |
# File 'lib/hashira/hotspots/file_cost.rb', line 15 def to_h = { file:, cognitive:, duplication:, churn:, cost:, rank: } |