mirror of https://github.com/apache/activemq.git
https://issues.apache.org/jira/browse/AMQ-3973 - data.db not calculated in store size
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1372859 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ce50e287ac
commit
a60442458e
|
@ -65,7 +65,6 @@ import org.apache.activemq.usage.MemoryUsage;
|
|||
import org.apache.activemq.usage.SystemUsage;
|
||||
import org.apache.activemq.util.ServiceStopper;
|
||||
import org.apache.activemq.wireformat.WireFormat;
|
||||
import org.apache.kahadb.util.ByteSequence;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.apache.kahadb.journal.Location;
|
||||
|
@ -994,7 +993,11 @@ public class KahaDBStore extends MessageDatabase implements PersistenceAdapter {
|
|||
}
|
||||
|
||||
public long size() {
|
||||
return storeSize.get();
|
||||
try {
|
||||
return journalSize.get() + getPageFile().getDiskSize();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void beginTransaction(ConnectionContext context) throws IOException {
|
||||
|
|
|
@ -207,7 +207,7 @@ public abstract class MessageDatabase extends ServiceSupport implements BrokerSe
|
|||
protected boolean enableJournalDiskSyncs=true;
|
||||
protected boolean archiveDataLogs;
|
||||
protected File directoryArchive;
|
||||
protected AtomicLong storeSize = new AtomicLong(0);
|
||||
protected AtomicLong journalSize = new AtomicLong(0);
|
||||
long checkpointInterval = 5*1000;
|
||||
long cleanupInterval = 30*1000;
|
||||
int journalMaxFileLength = Journal.DEFAULT_MAX_FILE_LENGTH;
|
||||
|
@ -2170,7 +2170,7 @@ public abstract class MessageDatabase extends ServiceSupport implements BrokerSe
|
|||
manager.setChecksum(checksumJournalFiles || checkForCorruptJournalFiles);
|
||||
manager.setWriteBatchSize(getJournalMaxWriteBatchSize());
|
||||
manager.setArchiveDataLogs(isArchiveDataLogs());
|
||||
manager.setSizeAccumulator(storeSize);
|
||||
manager.setSizeAccumulator(journalSize);
|
||||
manager.setEnableAsyncDiskSync(isEnableJournalDiskSyncs());
|
||||
if (getDirectoryArchive() != null) {
|
||||
IOHelper.mkdirs(getDirectoryArchive());
|
||||
|
|
|
@ -92,6 +92,8 @@ public class KahaDBFastEnqueueTest {
|
|||
LOG.info("Rate: " + (toSend * 1000/duration) + "m/s");
|
||||
LOG.info("Total send: " + totalSent);
|
||||
LOG.info("Total journal write: " + kahaDBPersistenceAdapter.getStore().getJournal().length());
|
||||
LOG.info("Total index size " + kahaDBPersistenceAdapter.getStore().getPageFile().getDiskSize());
|
||||
LOG.info("Total store size: " + kahaDBPersistenceAdapter.size());
|
||||
LOG.info("Journal writes %: " + kahaDBPersistenceAdapter.getStore().getJournal().length() / (double)totalSent * 100 + "%");
|
||||
|
||||
restartBroker(0, 1200000);
|
||||
|
@ -134,6 +136,8 @@ public class KahaDBFastEnqueueTest {
|
|||
LOG.info("Rate: " + (toSend * 1000/duration) + "m/s");
|
||||
LOG.info("Total send: " + totalSent);
|
||||
LOG.info("Total journal write: " + kahaDBPersistenceAdapter.getStore().getJournal().length());
|
||||
LOG.info("Total index size " + kahaDBPersistenceAdapter.getStore().getPageFile().getDiskSize());
|
||||
LOG.info("Total store size: " + kahaDBPersistenceAdapter.size());
|
||||
LOG.info("Journal writes %: " + kahaDBPersistenceAdapter.getStore().getJournal().length() / (double)totalSent * 100 + "%");
|
||||
|
||||
restartBroker(0, 0);
|
||||
|
|
Loading…
Reference in New Issue