Simplify score breakdown code
Before this MR we calculated the score in 3 different places. calculateHostWeightFn
, EstimateHostScore
and managedScoreBreakdown
.
This MR changes that by introducing a HostAdjustments
helper struct which by itself doesn't have a Score
or ConversionRate
field but offers Score
method which calculates a score from all the adjustments and a HostScoreBreakdown
method which creates a whole modules.HostScoreBreakdown
. HostScoreBreakdown
also allows the caller to ignore age and uptime when creating the breakdown.
Edited by Christopher Schinnerl