use of org.apache.qpid.disttest.message.ProducerParticipantResult in project qpid-broker-j by apache.
the class ParticipantResultFactory method createForProducer.
public ProducerParticipantResult createForProducer(String participantName, String clientRegisteredName, CreateProducerCommand command, int acknowledgeMode, int numberOfMessagesSent, int payloadSize, long totalPayloadSent, Date start, Date end, String providerVersion, String protocolVersion) {
final ProducerParticipantResult producerParticipantResult = new ProducerParticipantResult();
producerParticipantResult.setDeliveryMode(command.getDeliveryMode());
producerParticipantResult.setPriority(command.getPriority());
producerParticipantResult.setInterval(command.getInterval());
producerParticipantResult.setTimeToLive(command.getTimeToLive());
producerParticipantResult.setTotalNumberOfConsumers(0);
producerParticipantResult.setTotalNumberOfProducers(1);
producerParticipantResult.setProviderVersion(providerVersion);
producerParticipantResult.setProtocolVersion(protocolVersion);
setTestProperties(producerParticipantResult, command, participantName, clientRegisteredName, acknowledgeMode);
setTestResultProperties(producerParticipantResult, numberOfMessagesSent, payloadSize, totalPayloadSent, start, end);
return producerParticipantResult;
}
use of org.apache.qpid.disttest.message.ProducerParticipantResult in project qpid-broker-j by apache.
the class TestResultAggregatorTest method createResultsFromTest.
private TestResult createResultsFromTest() {
TestResult testResult = new TestResult(TEST1_NAME);
ConsumerParticipantResult consumerResult1 = new ConsumerParticipantResult();
setPropertiesOn(consumerResult1, TEST1_NAME, TEST1_ITERATION_NUMBER, CONSUMER_PARTICIPANT_NAME1, NUMBER_OF_MESSAGES_PROCESSED_PER_CONSUMER, BATCH_SIZE, PAYLOAD_SIZE, TOTAL_PAYLOAD_PROCESSED_PER_CONSUMER, CONSUMER1_STARTDATE, CONSUMER1_ENDDATE, 1, 0, PROVIDER_VERSION, PROTOCOL_VERSION);
testResult.addParticipantResult(consumerResult1);
ConsumerParticipantResult consumerResult2 = new ConsumerParticipantResult();
setPropertiesOn(consumerResult2, TEST1_NAME, TEST1_ITERATION_NUMBER, CONSUMER_PARTICIPANT_NAME2, NUMBER_OF_MESSAGES_PROCESSED_PER_CONSUMER, BATCH_SIZE, PAYLOAD_SIZE, TOTAL_PAYLOAD_PROCESSED_PER_CONSUMER, CONSUMER2_STARTDATE, CONSUMER2_ENDDATE, 1, 0, PROVIDER_VERSION, PROTOCOL_VERSION);
testResult.addParticipantResult(consumerResult2);
ParticipantResult producerResult = new ProducerParticipantResult();
setPropertiesOn(producerResult, TEST1_NAME, TEST1_ITERATION_NUMBER, PRODUCER_PARTICIPANT_NAME, NUMBER_OF_MESSAGES_PRODUCED, BATCH_SIZE, PAYLOAD_SIZE, TOTAL_PAYLOAD_PRODUCED_IN_TOTAL, PRODUCER_STARTDATE, PRODUCER_ENDDATE, 0, 1, PROVIDER_VERSION, PROTOCOL_VERSION);
testResult.addParticipantResult(producerResult);
return testResult;
}
use of org.apache.qpid.disttest.message.ProducerParticipantResult in project qpid-broker-j by apache.
the class ParticipantResultFactoryTest method testCreateForProducer.
@Test
public void testCreateForProducer() {
CreateProducerCommand command = new CreateProducerCommand();
setCommonCommandFields(command);
int deliveryMode = DeliveryMode.PERSISTENT;
command.setDeliveryMode(deliveryMode);
int priority = 5;
command.setPriority(priority);
long producerInterval = 50;
command.setInterval(producerInterval);
long timeToLive = 60;
command.setTimeToLive(timeToLive);
int totalNumberOfConsumers = 0;
int totalNumberOfProducers = 1;
int acknowledgeMode = 1;
ProducerParticipantResult result = _participantResultFactory.createForProducer(PARTICIPANT_NAME, REGISTERED_CLIENT_NAME, command, acknowledgeMode, NUMBER_OF_MESSAGES_PROCESSED, PAYLOAD_SIZE, TOTAL_PAYLOAD_PROCESSED, START, END, PROVIDER_VERSION, PROTOCOL_VERSION);
assertCommonResultProperties(result);
assertEquals((long) deliveryMode, (long) result.getDeliveryMode());
assertEquals((long) acknowledgeMode, (long) result.getAcknowledgeMode());
assertEquals((long) priority, (long) result.getPriority());
assertEquals(producerInterval, result.getInterval());
assertEquals(timeToLive, result.getTimeToLive());
assertEquals((long) totalNumberOfConsumers, (long) result.getTotalNumberOfConsumers());
}
use of org.apache.qpid.disttest.message.ProducerParticipantResult 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());
}
}
Aggregations