huadream opened a new issue #3448: Quota calculation is incorrect
URL: https://github.com/apache/cloudstack/issues/3448
 
 
   <!--
   Verify first that your issue/request is not already reported on GitHub.
   Also test if the latest release and master branch are affected too.
   Always add information AFTER of these HTML comments, but no need to delete 
the comments.
   -->
   
   ##### ISSUE TYPE
   <!-- Pick one below and delete the rest -->
    * Bug Report
   
   ##### COMPONENT NAME
   <!--
   Categorize the issue, e.g. API, VR, VPN, UI, etc.
   -->
   ~~~
   Quota
   ~~~
   
   ##### CLOUDSTACK VERSION
   <!--
   New line separated list of affected versions, commit ID for issues on master 
branch.
   -->
   
   ~~~
   master branch
   ~~~
   
   ##### CONFIGURATION
   <!--
   Information about the configuration if relevant, e.g. basic network, 
advanced networking, etc.  N/A otherwise
   -->
   
   
   ##### OS / ENVIRONMENT
   <!--
   Information about the environment if relevant, N/A otherwise
   -->
   
   
   ##### SUMMARY
   <!-- Explain the problem/feature briefly -->
   
   
https://github.com/apache/cloudstack/blob/1d05fead49f5c856257a741b07122f5633d2e359/framework/quota/src/main/java/org/apache/cloudstack/quota/QuotaManagerImpl.java#L101
   The default value of `usage.stats.job.aggregation.range` is 1440.
   _aggregationDuration = Integer.parseInt(aggregationRange);
   
https://github.com/apache/cloudstack/blob/1d05fead49f5c856257a741b07122f5633d2e359/framework/quota/src/main/java/org/apache/cloudstack/quota/QuotaManagerImpl.java#L142
   The value of `aggregationRatio` calculated is `1440/(30 * 24 * 60)`.
   
https://github.com/apache/cloudstack/blob/1d05fead49f5c856257a741b07122f5633d2e359/framework/quota/src/main/java/org/apache/cloudstack/quota/QuotaManagerImpl.java#L436
   This line would be one-day-cost not one-hour-cost.
   So the `aggregationRatio` should be fixed with `1/(30 * 24)`.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to