diff options
Diffstat (limited to 'testsuites/performance/performance-benchmark-test/src/main')
5 files changed, 18 insertions, 18 deletions
diff --git a/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventBatch.java b/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventBatch.java index 99f480b6c..3e3658349 100644 --- a/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventBatch.java +++ b/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventBatch.java @@ -55,8 +55,8 @@ public class EventBatch { this.apexClient = apexClient; // Create the events for the batch of events - for (int eventNumber = 0; eventNumber < batchSize; eventNumber++) { - InputEvent inputEvent = new InputEvent(); + for (var eventNumber = 0; eventNumber < batchSize; eventNumber++) { + var inputEvent = new InputEvent(); inputEvent.setTestSlogan(getEventSlogan(eventNumber)); inputEventMap.put(eventNumber, inputEvent); } @@ -72,9 +72,9 @@ public class EventBatch { return inputEventMap.get(0).asJson(); } - StringBuilder jsonBuilder = new StringBuilder(); + var jsonBuilder = new StringBuilder(); jsonBuilder.append("[\n"); - boolean first = true; + var first = true; for (InputEvent inputEvent : inputEventMap.values()) { if (first) { first = false; @@ -95,7 +95,7 @@ public class EventBatch { * @return the event slogan */ private String getEventSlogan(final int eventNumber) { - StringBuilder testSloganBuilder = new StringBuilder(); + var testSloganBuilder = new StringBuilder(); testSloganBuilder.append(batchNumber); testSloganBuilder.append('-'); testSloganBuilder.append(eventNumber); diff --git a/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventBatchStats.java b/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventBatchStats.java index fa5083ed0..d7b9daf14 100644 --- a/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventBatchStats.java +++ b/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventBatchStats.java @@ -26,7 +26,6 @@ import java.util.List; import lombok.Getter; import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.commons.lang3.tuple.Pair; -import org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator.events.OutputEvent; /** * This POJO class returns statistics on a event batch execution in Apex. @@ -85,7 +84,7 @@ public class EventBatchStats { long accumulatedRoundTripTime = 0; long accumulatedApexExecutionTime = 0; - for (int eventNo = 0; eventNo < batchSize; eventNo++) { + for (var eventNo = 0; eventNo < batchSize; eventNo++) { Pair<Long, Long> eventTimings = calculateEventTimings(eventBatch, eventNo); if (eventTimings == null) { // The event has not been sent yet or the response has not been received yet @@ -154,7 +153,7 @@ public class EventBatchStats { // If an event is in a batch, it has been sent eventsSent++; - OutputEvent outputEvent = eventBatch.getOutputEvent(eventNo); + var outputEvent = eventBatch.getOutputEvent(eventNo); if (outputEvent == null) { eventsNotReceived++; diff --git a/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGenerator.java b/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGenerator.java index 91f84b66b..51b6c7cae 100644 --- a/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGenerator.java +++ b/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGenerator.java @@ -65,7 +65,7 @@ public class EventGenerator { LOGGER.info("Event generator REST server starting"); - final ResourceConfig rc = new ResourceConfig(EventGeneratorEndpoint.class); + final var rc = new ResourceConfig(EventGeneratorEndpoint.class); eventGeneratorServer = GrizzlyHttpServerFactory.createHttpServer(getBaseUri(), rc); // Wait for the HTTP server to come up @@ -147,7 +147,7 @@ public class EventGenerator { LOGGER.info("Starting event generator with arguments: {}", Arrays.toString(args)); } - EventGeneratorParameterHandler parameterHandler = new EventGeneratorParameterHandler(); + var parameterHandler = new EventGeneratorParameterHandler(); EventGeneratorParameters parameters = null; @@ -166,7 +166,7 @@ public class EventGenerator { } // Start the event generator - EventGenerator eventGenerator = new EventGenerator(parameters); + var eventGenerator = new EventGenerator(parameters); LOGGER.info("Event generator started"); // Wait for event generation to finish diff --git a/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorEndpoint.java b/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorEndpoint.java index 6cbee6935..53e57f295 100644 --- a/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorEndpoint.java +++ b/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorEndpoint.java @@ -115,7 +115,7 @@ public class EventGeneratorEndpoint { return Response.status(204).build(); } - EventBatch batch = new EventBatch(parameters.get().getBatchSize(), getApexClient()); + var batch = new EventBatch(parameters.get().getBatchSize(), getApexClient()); batchMap.put(batch.getBatchNumber(), batch); return Response.status(200).entity(batch.getBatchAsJsonString()).build(); @@ -130,7 +130,7 @@ public class EventGeneratorEndpoint { @Path("/PostEvent") @POST public Response postEventResponse(final String jsonString) { - final OutputEvent outputEvent = new Gson().fromJson(jsonString, OutputEvent.class); + final var outputEvent = new Gson().fromJson(jsonString, OutputEvent.class); EventBatch batch = batchMap.get(outputEvent.findBatchNumber()); diff --git a/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorParameterHandler.java b/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorParameterHandler.java index 912290097..16e72a2b9 100644 --- a/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorParameterHandler.java +++ b/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorParameterHandler.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2018 Ericsson. All rights reserved. * Modifications Copyright (C) 2020 Nordix Foundation. + * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -99,7 +100,7 @@ public class EventGeneratorParameterHandler { * @throws ParseException on parse errors */ public EventGeneratorParameters parse(final String[] args) throws ParseException { - CommandLine commandLine = new DefaultParser().parse(options, args); + var commandLine = new DefaultParser().parse(options, args); final String[] remainingArgs = commandLine.getArgs(); if (remainingArgs.length > 0) { @@ -110,7 +111,7 @@ public class EventGeneratorParameterHandler { return null; } - EventGeneratorParameters parameters = new EventGeneratorParameters(); + var parameters = new EventGeneratorParameters(); if (commandLine.hasOption('c')) { parameters = getParametersFromJsonFile(commandLine.getOptionValue(CONFIGURATION_FILE)); @@ -200,10 +201,10 @@ public class EventGeneratorParameterHandler { * @return help string */ public String getHelp(final String mainClassName) { - final StringWriter stringWriter = new StringWriter(); - final PrintWriter stringPrintWriter = new PrintWriter(stringWriter); + final var stringWriter = new StringWriter(); + final var stringPrintWriter = new PrintWriter(stringWriter); - final HelpFormatter helpFormatter = new HelpFormatter(); + final var helpFormatter = new HelpFormatter(); helpFormatter.printHelp(stringPrintWriter, MAX_HELP_LINE_LENGTH, mainClassName + " [options...] ", "", options, 0, 0, ""); |