use of net.dempsy.monitoring.ClusterStatsCollector in project Dempsy by Dempsy.
the class TestInstanceManager method setupContainer.
@SuppressWarnings("resource")
public Container setupContainer(final MessageProcessorLifecycle<?> prototype) throws ContainerException {
dispatcher = new DummyDispatcher();
statsCollector = new BasicClusterStatsCollector();
manager = new NonLockingAltContainer().setMessageProcessor(prototype).setClusterId(new ClusterId("test", "test"));
manager.setDispatcher(dispatcher);
manager.setInbound(new DummyInbound());
tm = new DefaultThreadingModel(TestInstanceManager.class.getName());
tm.start(TestInstanceManager.class.getName());
manager.start(new TestInfrastructure(tm) {
BasicNodeStatsCollector nStats = new BasicNodeStatsCollector();
@Override
public ClusterStatsCollector getClusterStatsCollector(final ClusterId clusterId) {
return statsCollector;
}
@Override
public NodeStatsCollector getNodeStatsCollector() {
return nStats;
}
});
return manager;
}
use of net.dempsy.monitoring.ClusterStatsCollector in project Dempsy by Dempsy.
the class TestContainerLoadHandling method setUp.
@Before
public void setUp() throws Exception {
final ClusterId cid = new ClusterId("TestContainerLoadHandling", "test" + sequence++);
dispatcher = new MockDispatcher();
final BasicClusterStatsCollector sc = new BasicClusterStatsCollector();
clusterStats = sc;
nodeStats = new BasicNodeStatsCollector();
container = tr.track(new Manager<Container>(Container.class).getAssociatedInstance(containerId)).setMessageProcessor(new MessageProcessor<TestMessageProcessor>(new TestMessageProcessor())).setClusterId(cid);
container.setDispatcher(dispatcher);
container.setInbound(new DummyInbound());
container.start(new TestInfrastructure(null, null) {
@Override
public ClusterStatsCollector getClusterStatsCollector(final ClusterId clusterId) {
return sc;
}
@Override
public NodeStatsCollector getNodeStatsCollector() {
return nodeStats;
}
});
forceOutputException = false;
stillRunning = true;
}
Aggregations