Tabnine Logo
SizeStatisticImpl
Code IndexAdd Tabnine to your IDE (free)

How to use
SizeStatisticImpl
in
org.apache.activemq.management

Best Java code snippets using org.apache.activemq.management.SizeStatisticImpl (Showing top 20 results out of 315)

origin: apache/activemq

@Override
protected synchronized void onLoad(ListNode<String, Location> node, Transaction tx) {
  try {
    Iterator<Entry<String, Location>> i = node.iterator(tx);
    while (i.hasNext()) {
      messageSize.addSize(i.next().getValue().getSize());
    }
  } catch (IOException e) {
    LOG.warn("could not increment message size", e);
  }
}
origin: apache/activemq

public OrderedPendingList() {
  messageSize = new SizeStatisticImpl("messageSize", "The size in bytes of the pending messages");
  messageSize.setEnabled(true);
  pendingMessageHelper = new PendingMessageHelper(map, messageSize);
}
origin: apache/activemq

  @Override
  protected synchronized void appendFieldDescription(StringBuffer buffer) {
    buffer.append(" count: ");
    buffer.append(Long.toString(count));
    buffer.append(" maxSize: ");
    buffer.append(Long.toString(maxSize));
    buffer.append(" minSize: ");
    buffer.append(Long.toString(minSize));
    buffer.append(" totalSize: ");
    buffer.append(Long.toString(totalSize));
    buffer.append(" averageSize: ");
    buffer.append(Double.toString(getAverageSize()));
    buffer.append(" averageTimeExMinMax: ");
    buffer.append(Double.toString(getAveragePerSecondExcludingMinMax()));
    buffer.append(" averagePerSecond: ");
    buffer.append(Double.toString(getAveragePerSecond()));
    buffer.append(" averagePerSecondExMinMax: ");
    buffer.append(Double.toString(getAveragePerSecondExcludingMinMax()));
    super.appendFieldDescription(buffer);
  }
}
origin: apache/activemq

@Override
public void writePayload(final MessageStoreStatistics object, final DataOutput dataOut) throws IOException {
  dataOut.writeBoolean(null != object);
  if (object != null) {
    dataOut.writeLong(object.getMessageCount().getCount());
    dataOut.writeLong(object.getMessageSize().getTotalSize());
    dataOut.writeLong(object.getMessageSize().getMaxSize());
    dataOut.writeLong(object.getMessageSize().getMinSize());
    dataOut.writeLong(object.getMessageSize().getCount());
  }
}
origin: apache/activemq

  recoveredStatistics.getMessageCount().subtract(ackedAndPrepared.size());
  getMessageStoreStatistics().getMessageCount().setCount(recoveredStatistics.getMessageCount().getCount());
  getMessageStoreStatistics().getMessageSize().setTotalSize(recoveredStatistics.getMessageSize().getTotalSize());
} finally {
  indexLock.writeLock().unlock();
origin: apache/activemq

@Override
public void clear() {
  this.root = null;
  this.tail = null;
  this.map.clear();
  this.messageSize.reset();
}
origin: apache/activemq

/**
 * @return the max size of a message (bytes)
*/
public long getMaxMessageSize() {
  return destination.getDestinationStatistics().getMessageSize().getMaxSize();
}
origin: apache/activemq

/**
 * @return the min size of a message (bytes)
 */
public long getMinMessageSize() {
  return destination.getDestinationStatistics().getMessageSize().getMinSize();
}
origin: apache/activemq

/**
 * @return the average number of steps per second
 */
public double getAveragePerSecond() {
  double d = 1000;
  double averageSize = getAverageSize();
  if (averageSize == 0) {
    return 0;
  }
  return d / averageSize;
}
origin: apache/activemq

public void removeSubscription(String subKey) {
  SubscriptionStatistics subStats = subStatistics.remove(subKey);
  //Subtract from the parent
  if (subStats != null) {
    getMessageCount().subtract(subStats.getMessageCount().getCount());
    getMessageSize().addSize(-subStats.getMessageSize().getTotalSize());
  }
}
origin: apache/activemq

@Override
public long messageSize() {
  return messageSize.getTotalSize();
}
origin: apache/activemq

public void setEnabled(boolean enabled) {
  super.setEnabled(enabled);
  messageCount.setEnabled(enabled);
  messageSize.setEnabled(enabled);
}
origin: apache/activemq

protected AbstractMessageStoreStatistics(boolean enabled, String countDescription, String sizeDescription) {
  messageCount = new CountStatisticImpl("messageCount", countDescription);
  messageSize = new SizeStatisticImpl("messageSize", sizeDescription);
  addStatistic("messageCount", messageCount);
  addStatistic("messageSize", messageSize);
  this.setEnabled(enabled);
}
origin: apache/activemq

  @Override
  public MessageStoreStatistics readPayload(final DataInput dataIn) throws IOException {
    if (!dataIn.readBoolean()) {
      return null;
    }
    MessageStoreStatistics messageStoreStatistics = new MessageStoreStatistics();
    messageStoreStatistics.getMessageCount().setCount(dataIn.readLong());
    messageStoreStatistics.getMessageSize().setTotalSize(dataIn.readLong());
    messageStoreStatistics.getMessageSize().setMaxSize(dataIn.readLong());
    messageStoreStatistics.getMessageSize().setMinSize(dataIn.readLong());
    messageStoreStatistics.getMessageSize().setCount(dataIn.readLong());
    return messageStoreStatistics;
  }
}
origin: apache/activemq

@Override
public void recoverMessageStoreStatistics() throws IOException {
  synchronized (messageTable) {
    long size = 0;
    int count = 0;
    for (Message message : messageTable.values()) {
      size += message.getSize();
    }
    getMessageStoreStatistics().reset();
    getMessageStoreStatistics().getMessageCount().setCount(count);
    getMessageStoreStatistics().getMessageSize().setTotalSize(size);
  }
}
origin: org.apache.activemq/activemq-kahadb-store

  getMessageStoreStatistics().getMessageSize().setTotalSize(recoveredStatistics.getMessageSize().getTotalSize());
} finally {
  indexLock.writeLock().unlock();
origin: apache/activemq

@Override
public synchronized void clear(Transaction tx) throws IOException {
  messageSize.reset();
  super.clear(tx);
}
origin: apache/activemq

/**
 * @return the max size of a message (bytes)
 */
@Override
public long getMaxMessageSize() {
  return destination.getDestinationStatistics().getMessageSize().getMaxSize();
}
origin: apache/activemq

/**
 * @return the min size of a message (bytes)
 */
@Override
public long getMinMessageSize() {
  return destination.getDestinationStatistics().getMessageSize().getMinSize();
}
origin: apache/activemq

/**
 * @return the average size of a message (bytes)
 */
public double getAverageMessageSize() {
  return destination.getDestinationStatistics().getMessageSize().getAverageSize();
}
org.apache.activemq.managementSizeStatisticImpl

Most used methods

  • addSize
  • <init>
  • getAverageSize
  • getMaxSize
  • getMinSize
  • getTotalSize
  • reset
  • setEnabled
  • setTotalSize
    Reset the total size to the new value
  • getAveragePerSecond
  • getAveragePerSecondExcludingMinMax
  • getAverageSizeExcludingMinMax
  • getAveragePerSecondExcludingMinMax,
  • getAverageSizeExcludingMinMax,
  • isDoReset,
  • setParent,
  • updateSampleTime,
  • getCount,
  • setCount,
  • setMaxSize,
  • setMinSize

Popular in Java

  • Reading from database using SQL prepared statement
  • setRequestProperty (URLConnection)
  • startActivity (Activity)
  • getContentResolver (Context)
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Table (org.hibernate.mapping)
    A relational table
  • Runner (org.openjdk.jmh.runner)
  • Top 15 Vim Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now