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());
}
}
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();
}
}
}
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());
}
Aggregations