Search in sources :

Example 1 with HeartbeatGenerator

use of org.opennms.core.ipc.sink.aws.sqs.heartbeat.HeartbeatGenerator in project opennms by OpenNMS.

the class HeartbeatSinkPerfIT method configureGenerators.

/**
 * Configure generators.
 *
 * @throws Exception the exception
 */
public void configureGenerators() throws Exception {
    System.err.println("Starting Heartbeat generators.");
    // Start the consumer
    final HeartbeatModule parallelHeartbeatModule = new HeartbeatModule() {

        @Override
        public int getNumConsumerThreads() {
            return NUM_CONSUMER_THREADS;
        }
    };
    final HeartbeatConsumer consumer = new HeartbeatConsumer(parallelHeartbeatModule, receivedMeter);
    consumerManager.registerConsumer(consumer);
    // Start the dispatcher
    final SyncDispatcher<Heartbeat> dispatcher = messageDispatcherFactory.createSyncDispatcher(HeartbeatModule.INSTANCE);
    // Fire up the generators
    generators = new ArrayList<>(NUM_GENERATORS);
    for (int k = 0; k < NUM_GENERATORS; k++) {
        final HeartbeatGenerator generator = new HeartbeatGenerator(dispatcher, RATE_PER_GENERATOR, sentMeter, sendTimer);
        generators.add(generator);
        generator.start();
    }
}
Also used : HeartbeatModule(org.opennms.core.ipc.sink.aws.sqs.heartbeat.HeartbeatModule) Heartbeat(org.opennms.core.ipc.sink.aws.sqs.heartbeat.Heartbeat) HeartbeatGenerator(org.opennms.core.ipc.sink.aws.sqs.heartbeat.HeartbeatGenerator) HeartbeatConsumer(org.opennms.core.ipc.sink.aws.sqs.heartbeat.HeartbeatConsumer)

Aggregations

Heartbeat (org.opennms.core.ipc.sink.aws.sqs.heartbeat.Heartbeat)1 HeartbeatConsumer (org.opennms.core.ipc.sink.aws.sqs.heartbeat.HeartbeatConsumer)1 HeartbeatGenerator (org.opennms.core.ipc.sink.aws.sqs.heartbeat.HeartbeatGenerator)1 HeartbeatModule (org.opennms.core.ipc.sink.aws.sqs.heartbeat.HeartbeatModule)1