Package org.apache.qpid.disttest.message

Examples of org.apache.qpid.disttest.message.ConsumerParticipantResult


    public ConsumerParticipantResult createForConsumer(String participantName, String clientRegisteredName,
            CreateConsumerCommand command, int acknowledgeMode, int numberOfMessagesReceived, int payloadSize,
            long totalPayloadReceived, Date start, Date end, Collection<Long> messageLatencies)
    {
        ConsumerParticipantResult consumerParticipantResult = new ConsumerParticipantResult();
        consumerParticipantResult.setMessageLatencies(messageLatencies);

        setTestProperties(consumerParticipantResult, command, participantName, clientRegisteredName, acknowledgeMode);
        setTestResultProperties(consumerParticipantResult, numberOfMessagesReceived, payloadSize, totalPayloadReceived, start, end);

        consumerParticipantResult.setTopic(command.isTopic());
        consumerParticipantResult.setDurableSubscription(command.isDurableSubscription());
        consumerParticipantResult.setBrowsingSubscription(command.isBrowsingSubscription());
        consumerParticipantResult.setSelector(command.getSelector() != null);
        consumerParticipantResult.setNoLocal(command.isNoLocal());
        consumerParticipantResult.setSynchronousConsumer(command.isSynchronous());
        consumerParticipantResult.setTotalNumberOfConsumers(1);
        consumerParticipantResult.setTotalNumberOfProducers(0);

        SeriesStatistics statistics = new SeriesStatistics(messageLatencies);
        consumerParticipantResult.setAverageLatency(statistics.getAverage());
        consumerParticipantResult.setMinLatency(statistics.getMinimum());
        consumerParticipantResult.setMaxLatency(statistics.getMaximum());
        consumerParticipantResult.setLatencyStandardDeviation(statistics.getStandardDeviation());
        return consumerParticipantResult;
    }
View Full Code Here


        TestResult testResult1 = resultList.get(0);
        assertEquals("Unexpected test name", "Test 1", testResult1.getName());
        List<ParticipantResult> test1ParticipantResults = testResult1.getParticipantResults();
        assertEquals("Unexpected number of participant results for test 1", 2, test1ParticipantResults.size());
        assertParticipantNames(test1ParticipantResults, "participantConsumer1", "participantProducer1");
        ConsumerParticipantResult result = null;
        for (ParticipantResult participantResult : test1ParticipantResults)
        {
            if (participantResult instanceof ConsumerParticipantResult)
            {
                result = (ConsumerParticipantResult)participantResult;
                break;
            }
        }
        assertNotNull("Consumer results not recived", result);
        Collection<Long> latencies = result.getMessageLatencies();
        assertNotNull("Latency results are not collected", latencies);
        assertEquals("Unexpected latency results", 1, latencies.size());
    }
View Full Code Here

        List<ParticipantResult> test1ParticipantResults = testResult1.getParticipantResults();
        assertEquals("Unexpected number of participant results for test", 4, test1ParticipantResults.size());

        assertParticipantNames(test1ParticipantResults, "participantConsumer1", "participantConsumer2", "participantConsumer3", "participantProducer1");

        ConsumerParticipantResult consumer1 = (ConsumerParticipantResult) test1ParticipantResults.get(0);
        assertEquals(3, consumer1.getNumberOfMessagesProcessed());
        assertEquals(true, consumer1.isSynchronousConsumer());

        ProducerParticipantResult producer1 = (ProducerParticipantResult) test1ParticipantResults.get(3);
        assertEquals(9, producer1.getNumberOfMessagesProcessed());
        assertEquals(2, producer1.getBatchSize());
        assertEquals(50, producer1.getInterval());
View Full Code Here

    CSVOrderParticipantResultComparator _comparator = new CSVOrderParticipantResultComparator();

    public void testOrderedConsumerParticipants() throws Exception
    {
        assertCompare(
                new ConsumerParticipantResult("apple"),
                new ConsumerParticipantResult("banana"));

    }
View Full Code Here

    }
    public void testProducerPrecedesConsumerParticipants() throws Exception
    {
        assertCompare(
                new ProducerParticipantResult(),
                new ConsumerParticipantResult());
    }
View Full Code Here

    }

    public void testConsumerPrecedesAllConsumersResult()
    {
        assertCompare(
                new ConsumerParticipantResult("participantName"),
                new ParticipantResult(TestResultAggregator.ALL_CONSUMER_PARTICIPANTS_NAME));
    }
View Full Code Here

        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);

        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(totalNumberOfConsumers, result.getTotalNumberOfConsumers());
        assertEquals(totalNumberOfProducers, result.getTotalNumberOfProducers());
    }
View Full Code Here

    }

    private void assertLatencyAggregatedResults(ParticipantResult allConsumerParticipantResult)
    {
        assertTrue("Unexpected result", allConsumerParticipantResult instanceof ConsumerParticipantResult);
        ConsumerParticipantResult results = (ConsumerParticipantResult)allConsumerParticipantResult;
        assertEquals("Unexpected average", 5.0, results.getAverageLatency(), 0.01);
        assertEquals("Unexpected min", 2, results.getMinLatency());
        assertEquals("Unexpected max", 9, results.getMaxLatency());
        assertEquals("Unexpected standard deviation", 2.0, results.getLatencyStandardDeviation(), 0.01);
    }
View Full Code Here

    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);
        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);
        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);
View Full Code Here

TOP

Related Classes of org.apache.qpid.disttest.message.ConsumerParticipantResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.