Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.activemq.broker.region;

import org.apache.activemq.management.CountStatisticImpl;
import org.apache.activemq.management.StatsImpl;

import java.util.Set;

/**
* The J2EE Statistics for the Connection.
*
Expand All @@ -35,8 +36,7 @@ public ConnectionStatistics() {
enqueues = new CountStatisticImpl("enqueues", "The number of messages that have been sent to the connection");
dequeues = new CountStatisticImpl("dequeues", "The number of messages that have been dispatched from the connection");

addStatistic("enqueues", enqueues);
addStatistic("dequeues", dequeues);
addStatistics(Set.of(enqueues, dequeues));
}

public CountStatisticImpl getEnqueues() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.activemq.broker.region;

import org.apache.activemq.management.CountStatisticImpl;
import org.apache.activemq.management.PollCountStatisticImpl;
import org.apache.activemq.management.StatsImpl;

import java.util.Set;

/**
* The J2EE Statistics for the a Destination.
*
Expand All @@ -42,11 +43,7 @@ public ConnectorStatistics() {
messages = new CountStatisticImpl("messages", "The number of messages that that are being held by the destination");
messagesCached = new PollCountStatisticImpl("messagesCached", "The number of messages that are held in the destination's memory cache");

addStatistic("enqueues", enqueues);
addStatistic("dequeues", dequeues);
addStatistic("consumers", consumers);
addStatistic("messages", messages);
addStatistic("messagesCached", messagesCached);
addStatistics(Set.of(enqueues, dequeues, consumers, messages, messagesCached));
}

public CountStatisticImpl getEnqueues() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.activemq.broker.region;

import org.apache.activemq.management.CountStatisticImpl;
import org.apache.activemq.management.StatsImpl;

import java.util.Set;

/**
* The J2EE Statistics for the Connection.
*
Expand All @@ -41,10 +42,7 @@ public RegionStatistics(boolean enabled) {
destinations = new CountStatisticImpl("destinations", "The number of regular (non-adivsory) destinations in the region");
allDestinations = new CountStatisticImpl("allDestinations", "The total number of destinations, including advisory destinations, in the region");

addStatistic("advisoryDestinations", advisoryDestinations);
addStatistic("destinations", destinations);
addStatistic("allDestinations", allDestinations);

addStatistics(Set.of(advisoryDestinations, destinations, allDestinations));
this.setEnabled(enabled);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.activemq.broker.region;

import org.apache.activemq.management.CountStatisticImpl;
import org.apache.activemq.management.SizeStatisticImpl;
import org.apache.activemq.management.StatsImpl;

import java.util.Set;

/**
* The J2EE Statistics for a Subsription.
*/
Expand All @@ -32,7 +33,6 @@ public class SubscriptionStatistics extends StatsImpl {
protected CountStatisticImpl dispatched;
protected SizeStatisticImpl inflightMessageSize;


public SubscriptionStatistics() {
this(true);
}
Expand All @@ -45,12 +45,7 @@ public SubscriptionStatistics(boolean enabled) {
dequeues = new CountStatisticImpl("dequeues", "The number of messages that have been acknowledged from the subscription");
inflightMessageSize = new SizeStatisticImpl("inflightMessageSize", "The size in bytes of messages dispatched but awaiting acknowledgement");

addStatistic("consumedCount", consumedCount);
addStatistic("enqueues", enqueues);
addStatistic("dispatched", dispatched);
addStatistic("dequeues", dequeues);
addStatistic("inflightMessageSize", inflightMessageSize);

addStatistics(Set.of(consumedCount, enqueues, dispatched, dequeues, inflightMessageSize));
this.setEnabled(enabled);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.activemq.network;

import org.apache.activemq.management.CountStatisticImpl;
import org.apache.activemq.management.StatsImpl;

import java.util.Set;

/**
* The Statistics for a NetworkBridge.
*/
Expand All @@ -34,9 +35,7 @@ public NetworkBridgeStatistics() {
dequeues = new CountStatisticImpl("dequeues", "The current number of dequeues this bridge has, which is the number of messages received by the remote broker.");
receivedCount = new CountStatisticImpl("receivedCount", "The number of messages that have been received by the NetworkBridge from the remote broker. Only applies for Duplex bridges.");

addStatistic("enqueues", enqueues);
addStatistic("dequeues", dequeues);
addStatistic("receivedCount", receivedCount);
addStatistics(Set.of(enqueues, dequeues, receivedCount));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@
import org.apache.activemq.management.SizeStatisticImpl;
import org.apache.activemq.management.StatsImpl;

import java.util.Set;


public abstract class AbstractMessageStoreStatistics extends StatsImpl {

protected final CountStatisticImpl messageCount;
protected final SizeStatisticImpl messageSize;


protected AbstractMessageStoreStatistics(String countDescription, String sizeDescription) {
this(true, countDescription, sizeDescription);
}
Expand All @@ -37,9 +38,7 @@ protected AbstractMessageStoreStatistics(boolean enabled, String countDescriptio
messageCount = new CountStatisticImpl("messageCount", countDescription);
messageSize = new SizeStatisticImpl("messageSize", sizeDescription);

addStatistic("messageCount", messageCount);
addStatistic("messageSize", messageSize);

addStatistics(Set.of(messageCount, messageSize));
this.setEnabled(enabled);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.activemq.store;

import org.apache.activemq.management.CountStatisticImpl;
import org.apache.activemq.management.SizeStatisticImpl;
import org.apache.activemq.management.StatsImpl;

import java.util.Set;

/**
* The J2EE Statistics for a Message Sore
*/
Expand All @@ -39,9 +40,7 @@ public MessageStoreStatistics(boolean enabled) {
messageCount = new CountStatisticImpl("messageCount", "The number of messages in the store passing through the destination");
messageSize = new SizeStatisticImpl("messageSize","Size of messages in the store passing through the destination");

addStatistic("messageCount", messageCount);
addStatistic("messageSize", messageSize);

addStatistics(Set.of(messageCount, messageSize));
this.setEnabled(enabled);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/
package org.apache.activemq.store;

import java.util.Set;
import org.apache.activemq.management.StatsImpl;
import org.apache.activemq.management.TimeStatisticImpl;

Expand All @@ -31,14 +32,11 @@ public PersistenceAdapterStatistics() {
slowCleanupTime = new TimeStatisticImpl("slowCleanupTime", "Slow time to cleanup data in the PersistentAdapter.");
slowWriteTime = new TimeStatisticImpl("slowWriteTime", "Slow time to write data to the PersistentAdapter.");
slowReadTime = new TimeStatisticImpl("slowReadTime", "Slow time to read data from the PersistentAdapter.");
addStatistic("slowCleanupTime", slowCleanupTime);
addStatistic("slowWriteTime", slowWriteTime);
addStatistic("slowReadTime", slowReadTime);


writeTime = new TimeStatisticImpl("writeTime", "Time to write data to the PersistentAdapter.");
readTime = new TimeStatisticImpl("readTime", "Time to read data from the PersistentAdapter.");
addStatistic("writeTime", writeTime);
addStatistic("readTime", readTime);

addStatistics(Set.of(slowCleanupTime, slowWriteTime, slowReadTime, writeTime, readTime));
}

public void addSlowCleanupTime(final long time) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ protected synchronized void addStatistic(String name, StatisticImpl statistic) {
this.set.add(statistic);
}

protected void addStatistics(Collection<StatisticImpl> statistics) {
protected void addStatistics(final Collection<StatisticImpl> statistics) {
this.set.addAll(statistics);
}

protected void removeStatistics(Collection<StatisticImpl> statistics) {
protected void removeStatistics(final Collection<StatisticImpl> statistics) {
this.set.removeAll(statistics);
}
}