Search in sources :

Example 6 with ConsumerParticipantResult

use of org.apache.qpid.disttest.message.ConsumerParticipantResult in project qpid-broker-j by apache.

the class ParticipantResultAggregator method rollupConstantAttributes.

private void rollupConstantAttributes(ParticipantResult result) {
    if (result.getTestName() != null) {
        _encounteredTestNames.add(result.getTestName());
    }
    if (result.getProviderVersion() != null) {
        _encounteredProviderVersions.add(result.getProviderVersion());
    }
    if (result.getProtocolVersion() != null) {
        _encounteredProtocolVersions.add(result.getProtocolVersion());
    }
    _encounteredPayloadSizes.add(result.getPayloadSize());
    _encounteredIterationNumbers.add(result.getIterationNumber());
    _encounteredBatchSizes.add(result.getBatchSize());
    _encounteredAcknowledgeMode.add(result.getAcknowledgeMode());
    if (result instanceof ProducerParticipantResult) {
        ProducerParticipantResult producerParticipantResult = (ProducerParticipantResult) result;
        _encounteredDeliveryModes.add(producerParticipantResult.getDeliveryMode());
    } else if (result instanceof ConsumerParticipantResult) {
        ConsumerParticipantResult consumerParticipantResult = (ConsumerParticipantResult) result;
        _encounteredDurableSubscriptions.add(consumerParticipantResult.isDurableSubscription());
        _encounteredTopics.add(consumerParticipantResult.isTopic());
    }
}
Also used : ProducerParticipantResult(org.apache.qpid.disttest.message.ProducerParticipantResult) ConsumerParticipantResult(org.apache.qpid.disttest.message.ConsumerParticipantResult)

Example 7 with ConsumerParticipantResult

use of org.apache.qpid.disttest.message.ConsumerParticipantResult in project qpid-broker-j by apache.

the class ParticipantResultAggregator method aggregate.

public void aggregate(ParticipantResult result) {
    if (isAggregatable(result)) {
        rollupConstantAttributes(result);
        computeVariableAttributes(result);
        if (result instanceof ConsumerParticipantResult) {
            ConsumerParticipantResult consumerParticipantResult = (ConsumerParticipantResult) result;
            _latencyStatistics.addMessageLatencies(consumerParticipantResult.getMessageLatencies());
            _latencyStatistics.aggregate();
        }
    }
}
Also used : ConsumerParticipantResult(org.apache.qpid.disttest.message.ConsumerParticipantResult)

Example 8 with ConsumerParticipantResult

use of org.apache.qpid.disttest.message.ConsumerParticipantResult in project qpid-broker-j by apache.

the class ParticipantResultFactoryTest method testCreateForConsumer.

@Test
public void testCreateForConsumer() {
    CreateConsumerCommand command = new CreateConsumerCommand();
    setCommonCommandFields(command);
    boolean topic = true;
    command.setTopic(topic);
    boolean durable = true;
    command.setDurableSubscription(durable);
    boolean browsingSubscription = false;
    command.setBrowsingSubscription(browsingSubscription);
    String selector = "selector";
    boolean isSelector = true;
    command.setSelector(selector);
    boolean noLocal = false;
    command.setNoLocal(noLocal);
    boolean synchronousConsumer = true;
    command.setSynchronous(synchronousConsumer);
    int totalNumberOfConsumers = 1;
    int totalNumberOfProducers = 0;
    int acknowledgeMode = 2;
    ConsumerParticipantResult result = _participantResultFactory.createForConsumer(PARTICIPANT_NAME, REGISTERED_CLIENT_NAME, command, acknowledgeMode, NUMBER_OF_MESSAGES_PROCESSED, PAYLOAD_SIZE, TOTAL_PAYLOAD_PROCESSED, START, END, Collections.<Long>emptyList(), PROVIDER_VERSION, PROTOCOL_VERSION);
    assertCommonResultProperties(result);
    assertEquals(topic, result.isTopic());
    assertEquals(durable, result.isDurableSubscription());
    assertEquals(browsingSubscription, result.isBrowsingSubscription());
    assertEquals(isSelector, result.isSelector());
    assertEquals(noLocal, result.isNoLocal());
    assertEquals(synchronousConsumer, result.isSynchronousConsumer());
    assertEquals((long) totalNumberOfConsumers, (long) result.getTotalNumberOfConsumers());
    assertEquals((long) totalNumberOfProducers, (long) result.getTotalNumberOfProducers());
}
Also used : CreateConsumerCommand(org.apache.qpid.disttest.message.CreateConsumerCommand) ConsumerParticipantResult(org.apache.qpid.disttest.message.ConsumerParticipantResult) Test(org.junit.Test)

Aggregations

ConsumerParticipantResult (org.apache.qpid.disttest.message.ConsumerParticipantResult)8 ProducerParticipantResult (org.apache.qpid.disttest.message.ProducerParticipantResult)4 ParticipantResult (org.apache.qpid.disttest.message.ParticipantResult)3 TestResult (org.apache.qpid.disttest.controller.TestResult)2 Test (org.junit.Test)2 CreateConsumerCommand (org.apache.qpid.disttest.message.CreateConsumerCommand)1 SeriesStatistics (org.apache.qpid.disttest.results.aggregation.SeriesStatistics)1