ARTEMIS-3196 - expose journal pool files in JMX

https://issues.apache.org/jira/browse/ARTEMIS-3196
This commit is contained in:
Andy Taylor 2021-03-22 11:31:23 +00:00 committed by Gary Tully
parent 5a137fa0b7
commit bb94d0a5b3
4 changed files with 27 additions and 0 deletions

View File

@ -183,6 +183,12 @@ public interface ActiveMQServerControl {
@Attribute(desc = "Size of the internal buffer on the journal") @Attribute(desc = "Size of the internal buffer on the journal")
int getJournalBufferSize(); int getJournalBufferSize();
/**
* Number of files that would be acceptable to keep on a pool
*/
@Attribute(desc = "Number of files that would be acceptable to keep on a pool")
int getJournalPoolFiles();
/** /**
* Returns the timeout (in nanoseconds) used to flush internal buffers on the journal. * Returns the timeout (in nanoseconds) used to flush internal buffers on the journal.
*/ */

View File

@ -311,6 +311,21 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
} }
} }
@Override
public int getJournalPoolFiles() {
if (AuditLogger.isEnabled()) {
AuditLogger.getJournalBufferSize(this.server);
}
checkStarted();
clearIO();
try {
return configuration.getJournalPoolFiles();
} finally {
blockOnIO();
}
}
@Override @Override
public int getJournalBufferSize() { public int getJournalBufferSize() {
if (AuditLogger.isEnabled()) { if (AuditLogger.isEnabled()) {

View File

@ -197,6 +197,7 @@ public class ActiveMQServerControlTest extends ManagementTestBase {
Assert.assertEquals(conf.getJournalCompactMinFiles(), serverControl.getJournalCompactMinFiles()); Assert.assertEquals(conf.getJournalCompactMinFiles(), serverControl.getJournalCompactMinFiles());
Assert.assertEquals(conf.getJournalCompactPercentage(), serverControl.getJournalCompactPercentage()); Assert.assertEquals(conf.getJournalCompactPercentage(), serverControl.getJournalCompactPercentage());
Assert.assertEquals(conf.isPersistenceEnabled(), serverControl.isPersistenceEnabled()); Assert.assertEquals(conf.isPersistenceEnabled(), serverControl.isPersistenceEnabled());
Assert.assertEquals(conf.getJournalPoolFiles(), serverControl.getJournalPoolFiles());
Assert.assertTrue(serverControl.isActive()); Assert.assertTrue(serverControl.isActive());
} }

View File

@ -747,6 +747,11 @@ public class ActiveMQServerControlUsingCoreTest extends ActiveMQServerControlTes
return (Integer) proxy.retrieveAttributeValue("JournalBufferSize", Integer.class); return (Integer) proxy.retrieveAttributeValue("JournalBufferSize", Integer.class);
} }
@Override
public int getJournalPoolFiles() {
return (Integer) proxy.retrieveAttributeValue("getJournalPoolFiles", Integer.class);
}
@Override @Override
public int getJournalBufferTimeout() { public int getJournalBufferTimeout() {
return (Integer) proxy.retrieveAttributeValue("JournalBufferTimeout", Integer.class); return (Integer) proxy.retrieveAttributeValue("JournalBufferTimeout", Integer.class);