private void handleChangeManagerStatusRequest ( final HttpServletRequest req , final Map < String , Object > ret , final boolean enableMetricManager ) { try { logger . info ( "Updating metric manager status" ) ; if ( ( enableMetricManager && MetricReportManager . isInstantiated ( ) ) || MetricReportManager . isAvailable ( ) ) { final MetricReportManager metricManager = MetricReportManager . getInstance ( ) ; if ( enableMetricManager ) { metricManager . enableManager ( ) ; } else { metricManager . disableManager ( ) ; } ret . put ( STATUS_PARAM , RESPONSE_SUCCESS ) ; } else { ret . put ( RESPONSE_ERROR , "MetricManager is not available" ) ; } } catch ( final Exception e ) { logger . error ( e ) ; ret . put ( RESPONSE_ERROR , e . getMessage ( ) ) ; } }
enable or disable metric Manager A disable will also purge all data from all metric emitters