private Map<String,String> parseURL(HttpServletRequest req){
  Map<String,String> reqParams=new HashMap<String,String>();
  String path=req.getServletPath();
  if (path != null) {
    String[] paths=path.split("/");
    if (paths.length > 2) {
      reqParams.put(Constants.URL_PATH_CMD,paths[2]);
      if (paths.length > 3)       reqParams.put(Constants.URL_PATH_DBGROUP,paths[3]);
      if (paths.length > 4)       reqParams.put(Constants.URL_PATH_DBHOST,paths[4]);
      if (paths.length > 5)       reqParams.put(Constants.URL_PATH_METRICS,paths[5]);
      if (paths.length > 6)       reqParams.put(Constants.URL_PATH_START_TS,paths[6]);
      if (paths.length > 7)       reqParams.put(Constants.URL_PATH_END_TS,paths[7]);
    }
  }
  return reqParams;
}

private Map < String , String > parseURL ( HttpServletRequest req ) { Map < String , String > reqParams = new HashMap < String , String > ( ) ; String path = req . getServletPath ( ) ; if ( path != null ) { String [ ] paths = path . split ( "/" ) ; if ( paths . length > 2 ) { reqParams . put ( Constants . URL_PATH_CMD , paths [ 2 ] ) ; if ( paths . length > 3 ) reqParams . put ( Constants . URL_PATH_DBGROUP , paths [ 3 ] ) ; if ( paths . length > 4 ) reqParams . put ( Constants . URL_PATH_DBHOST , paths [ 4 ] ) ; if ( paths . length > 5 ) reqParams . put ( Constants . URL_PATH_METRICS , paths [ 5 ] ) ; if ( paths . length > 6 ) reqParams . put ( Constants . URL_PATH_START_TS , paths [ 6 ] ) ; if ( paths . length > 7 ) reqParams . put ( Constants . URL_PATH_END_TS , paths [ 7 ] ) ; } } return reqParams ; }
url path pattern : / metrics / { cmd } / { dbgroup } / { dbhost } / [ { metrics } / [ { start_ts } / ] [ { end_ts } / ] ] { random } . html cmd : get : get one or more metrics for one dbhost . metrics name separated by comma
