この修正を入れる前の実装で中身見てみた。元の hourly の実装時の数値
[1] pry(#<RSpec::ExampleGroups::DailyGoalAllocatorImpression::Allocate::WhenCampaignPeriodStartIsNotMidnight>)> daily_goals.map{|g| g.allocated }
=> [41153, 165536, 149422, 133308, 117194, 101080, 84966, 68852]
[2] pry(#<RSpec::ExampleGroups::DailyGoalAllocatorImpression::Allocate::WhenCampaignPeriodStartIsNotMidnight>)> reference_time
=> Thu, 24 Oct 2019 10:00:00 JST +09:00
時間が 10 時だから初日の allocate が一番少なくなっているように見えるようになっているだけに見えるので調査
hourly の実装全部外し(daily の値を取得)
[1] pry(#<RSpec::ExampleGroups::DailyGoalAllocatorImpression::Allocate::WhenCampaignPeriodStartIsNotMidnight>)> daily_goals.map{|g| g.allocated }
=> [181650, 165536, 149422, 133308, 117194, 101080, 84966, 68852]
やはり一番少ないのは最終日になっている。 なんとなく実装の意図的には初日は少なめでだんだん多めに出すようにしている気もするのでそのへんの仕様も含めて相談