Skip to content

Commit ff95beb

Browse files
ONE_MINUTE_IN_MILLISCONDS MUST be long (or Long)
1 parent af93624 commit ff95beb

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

server/src/main/java/com/cloud/server/StatsCollector.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,7 @@ public String toString() {
179179

180180
private static final int HOURLY_TIME = 60;
181181
private static final int DAILY_TIME = HOURLY_TIME * 24;
182-
private static final int ONE_MINUTE_IN_MILLISCONDS = 60 * 1000;
183-
182+
private static final Long ONE_MINUTE_IN_MILLISCONDS = 60000L;
184183
private static final String UUID_TAG = "uuid";
185184

186185
private static final String TOTAL_MEMORY_KBS_FIELD = "total_memory_kb";
@@ -332,11 +331,11 @@ public boolean start() {
332331
protected void init(Map<String, String> configs) {
333332
_executor = Executors.newScheduledThreadPool(6, new NamedThreadFactory("StatsCollector"));
334333

335-
hostStatsInterval = NumbersUtil.parseLong(configs.get("host.stats.interval"), 60000L);
336-
hostAndVmStatsInterval = NumbersUtil.parseLong(configs.get("vm.stats.interval"), 60000L);
337-
storageStatsInterval = NumbersUtil.parseLong(configs.get("storage.stats.interval"), 60000L);
338-
volumeStatsInterval = NumbersUtil.parseLong(configs.get("volume.stats.interval"), 600000L);
339-
autoScaleStatsInterval = NumbersUtil.parseLong(configs.get("autoscale.stats.interval"), 60000L);
334+
hostStatsInterval = NumbersUtil.parseLong(configs.get("host.stats.interval"), ONE_MINUTE_IN_MILLISCONDS);
335+
hostAndVmStatsInterval = NumbersUtil.parseLong(configs.get("vm.stats.interval"), ONE_MINUTE_IN_MILLISCONDS);
336+
storageStatsInterval = NumbersUtil.parseLong(configs.get("storage.stats.interval"), ONE_MINUTE_IN_MILLISCONDS);
337+
volumeStatsInterval = NumbersUtil.parseLong(configs.get("volume.stats.interval"), ONE_MINUTE_IN_MILLISCONDS);
338+
autoScaleStatsInterval = NumbersUtil.parseLong(configs.get("autoscale.stats.interval"), ONE_MINUTE_IN_MILLISCONDS);
340339

341340
String statsUri = statsOutputUri.value();
342341
if (StringUtils.isNotBlank(statsUri)) {

0 commit comments

Comments
 (0)