git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@685832 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2008-08-14 09:32:25 +00:00
parent 46b01cc862
commit 0cf384549c
2 changed files with 10 additions and 2 deletions

View File

@ -708,8 +708,8 @@ public class BrokerService implements Service {
if (systemUsage == null) { if (systemUsage == null) {
systemUsage = new SystemUsage("Main", getPersistenceAdapter(), getTempDataStore()); systemUsage = new SystemUsage("Main", getPersistenceAdapter(), getTempDataStore());
systemUsage.getMemoryUsage().setLimit(1024 * 1024 * 64); // Default 64 Meg systemUsage.getMemoryUsage().setLimit(1024 * 1024 * 64); // Default 64 Meg
systemUsage.getTempUsage().setLimit(1024 * 1024 * 1024 * 100); // 10 Gb systemUsage.getTempUsage().setLimit(1024L * 1024 * 1024 * 100); // 10 Gb
systemUsage.getStoreUsage().setLimit(1024 * 1024 * 1024 * 100); // 100 GB systemUsage.getStoreUsage().setLimit(1024L * 1024 * 1024 * 100); // 100 GB
addService(this.systemUsage); addService(this.systemUsage);
} }
return systemUsage; return systemUsage;

View File

@ -73,4 +73,12 @@ public class BrokerServiceTest extends TestCase {
connector.stop(); connector.stop();
service.stop(); service.stop();
} }
public void testSystemUsage()
{
BrokerService service = new BrokerService();
assertEquals( service.getSystemUsage().getMemoryUsage().getLimit(), 1024 * 1024 * 64 );
assertEquals( service.getSystemUsage().getTempUsage().getLimit(), 1024L * 1024 * 1024 * 100 );
assertEquals( service.getSystemUsage().getStoreUsage().getLimit(), 1024L * 1024 * 1024 * 100 );
}
} }