private void handleChangeMetricInterval(final HttpServletRequest req,
      final Map<String, Object> ret) throws ServletException {
    try {
      final String metricName = getParam(req, STATS_MAP_METRICNAMEPARAM);
      final long newInterval = getLongParam(req, STATS_MAP_REPORTINGINTERVAL);
      if (MetricReportManager.isAvailable()) {
        final MetricReportManager metricManager = MetricReportManager.getInstance();
        final TimeBasedReportingMetric<?> metric =
            (TimeBasedReportingMetric<?>) metricManager
                .getMetricFromName(metricName);
        metric.updateInterval(newInterval);
        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());
    }
  }
private void handleChangeMetricInterval ( final HttpServletRequest req , final Map < String , Object > ret ) throws ServletException { try { final String metricName = getParam ( req , STATS_MAP_METRICNAMEPARAM ) ; final long newInterval = getLongParam ( req , STATS_MAP_REPORTINGINTERVAL ) ; if ( MetricReportManager . isAvailable ( ) ) { final MetricReportManager metricManager = MetricReportManager . getInstance ( ) ; final TimeBasedReportingMetric < ? > metric = ( TimeBasedReportingMetric < ? > ) metricManager . getMetricFromName ( metricName ) ; metric . updateInterval ( newInterval ) ; 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 ( ) ) ; } }
Update tracking interval for a given metrics