-
Notifications
You must be signed in to change notification settings - Fork 896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[EUWE] Chargebacks for SCVMM (rollup-less) [2/2] #13554
Commits on Jan 18, 2017
-
Drop hours_in_interval public interface
of ChargebackRateDetail. (cherry picked from commit ae27ca5)
Configuration menu - View commit details
-
Copy full SHA for 96b46ad - Browse repository at this point
Copy the full SHA 96b46adView commit details -
Drop @hours_in_interval instance variable on ChargebackRateDetail
ChargebackRateDetail object should not know anything about some interval. It should just maintain the logic to calculate the cost. The @hours_in_interval is a function of given consumption slice. Moreover, there is a problem with @hours_in_interval -- the interval can be for instance one week, and the rate can be monthly, then we divide monthly cost by week. B@ng! (cherry picked from commit 09cecec)
Configuration menu - View commit details
-
Copy full SHA for 4f03ef6 - Browse repository at this point
Copy the full SHA 4f03ef6View commit details -
Fix calculation inaccurancy when report period is not month
When calculation hourly_rate for ChargebackRateDetail with monthly rate, we had assumed that lenght of report interval was good indicator of hours in month. This is however truth only for monthly reports. For example, assume monthly rate of $4 for fixed compute. On monthly report we charge correctly $4 (the hourly_rate is ($4 / 1.month). On weekly report, however we charge $4 per each week, as we assume that hourly_rate is ($4 / 1.week). (cherry picked from commit c3d3e85)
Configuration menu - View commit details
-
Copy full SHA for d9e004b - Browse repository at this point
Copy the full SHA d9e004bView commit details -
Split test cases for hourly rate
(cherry picked from commit 4f7e02c) Conflicts: spec/models/chargeback_rate_detail_spec.rb
Configuration menu - View commit details
-
Copy full SHA for 5201958 - Browse repository at this point
Copy the full SHA 5201958View commit details -
Spec for monthly rate and weekly consumption slice combination
(cherry picked from commit 3bfff04)
Configuration menu - View commit details
-
Copy full SHA for e8ef837 - Browse repository at this point
Copy the full SHA e8ef837View commit details -
Use let instead of class variable @admin
The before branch is run many many times again and again creating admin user for no good. (cherry picked from commit e9b9e30) Conflicts: spec/models/chargeback_vm_spec.rb
Configuration menu - View commit details
-
Copy full SHA for ed32a57 - Browse repository at this point
Copy the full SHA ed32a57View commit details -
Extract user instance var to let(:user) clause
(cherry picked from commit 2ac95eb)
Configuration menu - View commit details
-
Copy full SHA for 4f52e1e - Browse repository at this point
Copy the full SHA 4f52e1eView commit details -
Do not use @options, use let(:options) instead
(cherry picked from commit a300e10)
Configuration menu - View commit details
-
Copy full SHA for b4f411a - Browse repository at this point
Copy the full SHA b4f411aView commit details -
Define constants using let method
(cherry picked from commit d8dafb4) Conflicts: spec/models/chargeback_container_project_spec.rb spec/models/chargeback_vm_spec.rb
Configuration menu - View commit details
-
Copy full SHA for aba51b0 - Browse repository at this point
Copy the full SHA aba51b0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 470e6a3 - Browse repository at this point
Copy the full SHA 470e6a3View commit details -
Refactor: extract timestamp calculation
(cherry picked from commit d5817ba)
Configuration menu - View commit details
-
Copy full SHA for eb0b13c - Browse repository at this point
Copy the full SHA eb0b13cView commit details -
Do not create dozen of metric_rollups with hardcoded timestamp
This code was definititelly meant to be written this way. (cherry picked from commit 385e8d2)
Configuration menu - View commit details
-
Copy full SHA for 8511fb2 - Browse repository at this point
Copy the full SHA 8511fb2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1bdbd11 - Browse repository at this point
Copy the full SHA 1bdbd11View commit details -
Refactor hours_in_month to let statement
(cherry picked from commit bbe59f0) Conflicts: spec/models/chargeback_vm_spec.rb
Configuration menu - View commit details
-
Copy full SHA for f56ac97 - Browse repository at this point
Copy the full SHA f56ac97View commit details -
Refactor: extract @ems to let statement
(cherry picked from commit 5cc0a3c) Conflicts: spec/models/chargeback_container_project_spec.rb spec/models/chargeback_vm_spec.rb
Configuration menu - View commit details
-
Copy full SHA for 594d500 - Browse repository at this point
Copy the full SHA 594d500View commit details -
Refactor: Extract starting date
and fix related rubocop (cherry picked from commit f870d3c)
Configuration menu - View commit details
-
Copy full SHA for dc992ce - Browse repository at this point
Copy the full SHA dc992ceView commit details -
Specs: should charge after the given time passed
(cherry picked from commit 73c99b9)
Configuration menu - View commit details
-
Copy full SHA for f7e1472 - Browse repository at this point
Copy the full SHA f7e1472View commit details -
Do not charge for hours that are yet to come
For variable_rate, we charge only that much that has been consumed. Perhaps I'll end the service tmrw, I should not be charged in advanced. https://bugzilla.redhat.com/show_bug.cgi?id=1402072 (cherry picked from commit c94a8fb)
Configuration menu - View commit details
-
Copy full SHA for 24219e5 - Browse repository at this point
Copy the full SHA 24219e5View commit details -
Do not hardcode time value, they should be relative report_run_time
Otherwise, nobody will ever understand why we have them. Now each file includes single hardcoded datetime and everything else is relative to it. Think about it. That's actually meaning of the specs prescription. The hardcoded values were hardcoded to be relative to other hc values. (cherry picked from commit 4609f3c) Conflicts: spec/models/chargeback_container_image_spec.rb spec/models/chargeback_container_project_spec.rb spec/models/chargeback_vm_spec.rb
Configuration menu - View commit details
-
Copy full SHA for 0029941 - Browse repository at this point
Copy the full SHA 0029941View commit details -
Specs: Fixed rate should charge only past hours
https://bugzilla.redhat.com/show_bug.cgi?id=1402072 (cherry picked from commit 3a678bb)
Configuration menu - View commit details
-
Copy full SHA for 70c9a58 - Browse repository at this point
Copy the full SHA 70c9a58View commit details -
Specs: resources should be created before their consumption
We are gonna change code to charge only for consumption since the resource creation time. First, we need to make sure all our test subject have proper created_on timestamp. (cherry picked from commit e2d0561) Conflicts: spec/models/chargeback_container_project_spec.rb
Configuration menu - View commit details
-
Copy full SHA for 8b12151 - Browse repository at this point
Copy the full SHA 8b12151View commit details -
Do not charge for hours before resource creation
(cherry picked from commit 1317470)
Configuration menu - View commit details
-
Copy full SHA for 3b6b700 - Browse repository at this point
Copy the full SHA 3b6b700View commit details -
Charge SCVMM's vm only until it is retired.
(cherry picked from commit 41e9832)
Configuration menu - View commit details
-
Copy full SHA for 79603b4 - Browse repository at this point
Copy the full SHA 79603b4View commit details -
Do not yield consumption unless it represent real consumption
When resource did not exist in given interval (day, week, month) we will not yield Consumption object into the chargeback engine. As a result the report won't contain rows with zero consumption. (cherry picked from commit 166896f)
Configuration menu - View commit details
-
Copy full SHA for c0152ba - Browse repository at this point
Copy the full SHA c0152baView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1ef7a98 - Browse repository at this point
Copy the full SHA 1ef7a98View commit details