DaanHoogland commented on code in PR #13927:
URL: https://github.com/apache/cloudstack/pull/13927#discussion_r3854959828
##########
usage/src/main/java/com/cloud/usage/UsageManagerImpl.java:
##########
@@ -699,7 +700,10 @@ public void parse(UsageJobVO job, long startDateMillis,
long endDateMillis) {
if ((events != null) && (events.size() > 0)) {
Date oldestEventDate = events.get(0).getCreateDate();
if (oldestEventDate.getTime() < startDateMillis) {
- startDateMillis = oldestEventDate.getTime();
+ // Bound the rewind so a single un-processable event
cannot pin the
+ // aggregation window to an arbitrarily old date and
cause unbounded
+ // re-aggregation of the entire history on every run.
Review Comment:
this comment is not needed and makes the code less readable.
##########
usage/src/main/java/com/cloud/usage/UsageManagerImpl.java:
##########
@@ -103,6 +103,7 @@ public class UsageManagerImpl extends ManagerBase
implements UsageManager, Runna
private static final int HOURLY_TIME = 60;
private static final int DAILY_TIME = 60 * 24;
private static final int THREE_DAYS_IN_MINUTES = 60 * 24 * 3;
+ private static final long MAX_EVENT_REWIND_MILLIS = 24L * 60 * 60 * 1000;
Review Comment:
this must be configurable, just in case any operator uses a larger
aggregation window.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]