diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/DayCounterInfo.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/DayCounterInfo.java index 4cb124b6c9..1dce276be5 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/DayCounterInfo.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/DayCounterInfo.java @@ -32,7 +32,7 @@ public final class DayCounterInfo { private final String date; - private final int[] counters; + private final long[] counters; // Static -------------------------------------------------------- @@ -41,7 +41,7 @@ public final class DayCounterInfo { JsonArrayBuilder counters = JsonLoader.createArrayBuilder(); for (DayCounterInfo info : infos) { JsonArrayBuilder counter = JsonLoader.createArrayBuilder(); - for (int c : info.getCounters()) { + for (long c : info.getCounters()) { counter.add(c); } JsonObjectBuilder dci = JsonLoader.createObjectBuilder().add("date", info.getDate()).add("counters", counter); @@ -63,7 +63,7 @@ public final class DayCounterInfo { JsonObject counter = (JsonObject) dayCounters.get(i); JsonArray hour = counter.getJsonArray("counters"); - int[] hourCounters = new int[24]; + long[] hourCounters = new long[24]; for (int j = 0; j < 24; j++) { hourCounters[j] = hour.getInt(j); } @@ -75,7 +75,7 @@ public final class DayCounterInfo { // Constructors -------------------------------------------------- - public DayCounterInfo(final String date, final int[] counters) { + public DayCounterInfo(final String date, final long[] counters) { this.date = date; this.counters = counters; } @@ -93,7 +93,7 @@ public final class DayCounterInfo { * Returns a 24-length array corresponding to the number of messages added to the queue * for the given hour of the day. */ - public int[] getCounters() { + public long[] getCounters() { return counters; } } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/messagecounter/MessageCounter.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/messagecounter/MessageCounter.java index 522445dea0..3ee5e4adaa 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/messagecounter/MessageCounter.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/messagecounter/MessageCounter.java @@ -395,7 +395,7 @@ public class MessageCounter { GregorianCalendar date = null; - int[] counters = new int[DayCounter.HOURS]; + long[] counters = new long[DayCounter.HOURS]; /** * Constructor @@ -415,17 +415,17 @@ public class MessageCounter { for (int i = 0; i < DayCounter.HOURS; i++) { if (i < hour) { if (isStartDay) { - counters[i] = -1; + counters[i] = -1L; } else { - counters[i] = 0; + counters[i] = 0L; } } else { - counters[i] = -1; + counters[i] = -1L; } } // set the array element of the current hour to '0' - counters[hour] = 0; + counters[hour] = 0L; } /** @@ -437,7 +437,7 @@ public class MessageCounter { return (GregorianCalendar) date.clone(); } - public int[] getCounters() { + public long[] getCounters() { return counters; } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/messagecounter/impl/MessageCounterHelper.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/messagecounter/impl/MessageCounterHelper.java index 1688985b29..c8fe282cea 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/messagecounter/impl/MessageCounterHelper.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/messagecounter/impl/MessageCounterHelper.java @@ -38,7 +38,7 @@ public class MessageCounterHelper { DayCounterInfo[] infos = new DayCounterInfo[history.size()]; for (int i = 0; i < infos.length; i++) { DayCounter dayCounter = history.get(i); - int[] counters = dayCounter.getCounters(); + long[] counters = dayCounter.getCounters(); GregorianCalendar date = dayCounter.getDate(); DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.SHORT);