protected void handleStatsResetIfNeeded ( StatusData < ApacheMetrics > status ) { StatValue uptime = getStatValue ( ApacheMetrics . SERVER_UPTIME ) ; Long currUptime = Long . class . cast ( status . get ( ApacheMetrics . SERVER_UPTIME ) ) ; if ( uptime != null && currUptime != null && uptime . getValueAsLong ( ) > currUptime ) { for ( ApacheMetrics metric : getAvailableMetrics ( ) ) { if ( metric . getType ( ) == StatValueTypes . DIFFLONG ) { StatValue stat = getStatValue ( metric ) ; if ( stat != null ) stat . reset ( ) ; } } } }
Check SERVER_UPTIME metric and if its value is lower than the stored one - monitored apache server was restarted . In this case all DIFFLONG statValues need resetting .