Skip to content

Instantly share code, notes, and snippets.

@yoshiori
Created January 8, 2020 04:55
Show Gist options
  • Save yoshiori/003ff6b64687b2c58a5da3938466319d to your computer and use it in GitHub Desktop.
Save yoshiori/003ff6b64687b2c58a5da3938466319d to your computer and use it in GitHub Desktop.

この修正を入れる前の実装で中身見てみた。元の 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]

やはり一番少ないのは最終日になっている。 なんとなく実装の意図的には初日は少なめでだんだん多めに出すようにしている気もするのでそのへんの仕様も含めて相談

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment