use of org.apache.qpid.disttest.results.aggregation.SeriesStatistics in project qpid-broker-j by apache.
the class ParticipantResultFactory method createForConsumer.
public ConsumerParticipantResult createForConsumer(String participantName, String clientRegisteredName, CreateConsumerCommand command, int acknowledgeMode, int numberOfMessagesReceived, int payloadSize, long totalPayloadReceived, Date start, Date end, Collection<Long> messageLatencies, String providerVersion, String protocolVersion) {
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());
consumerParticipantResult.setProviderVersion(providerVersion);
consumerParticipantResult.setProtocolVersion(protocolVersion);
return consumerParticipantResult;
}
Aggregations