avoid spamming console with metrics for short sessions

This commit is contained in:
Jonathan Shook 2020-12-07 01:50:38 -06:00
parent 1529f2714e
commit 5315b8a98a

View File

@ -66,8 +66,15 @@ public class ScenariosResults {
logger.info("results for scenario: " + scenario);
if (oresult != null) {
oresult.reportToLog();
oresult.reportToConsole();
oresult.reportElapsedMillis();
if (oresult.getElapsedMillis() >= 60_000) {
oresult.reportToConsole();
oresult.reportToLog();
} else {
logger.info("Metrics suppressed because scenario was less than 1 minute long.");
logger.info("Metrics data is not reliable for short sampling periods.");
logger.info("To get metrics on console, run a longer scenario.");
}
} else {
logger.error(scenario.getScenarioName() + ": incomplete (missing result)");
}