public static void incrementStat(final PwmApplication pwmApplication, final Statistic statistic) { if (pwmApplication == null) { LOGGER.error( "skipping requested statistic increment of " + statistic + " due to null pwmApplication"); return; } final StatisticsManager statisticsManager = pwmApplication.getStatisticsManager(); if (statisticsManager == null) { LOGGER.error( "skipping requested statistic increment of " + statistic + " due to null statisticsManager"); return; } if (statisticsManager.status() != STATUS.OPEN) { LOGGER.trace( "skipping requested statistic increment of " + statistic + " due to StatisticsManager being closed"); return; } statisticsManager.incrementValue(statistic); }