code: @Override
      public final Collection<Metric> gatherMetrics(final ICommandLine cl) throws MetricGatheringException {
          List<Metric> metrics = new ArrayList<Metric>();
          String hostname = cl.getOptionValue("hostname");
          if (hostname == null) {
              throw new MetricGatheringException("No hostname specified.", Status.WARNING, null);
          }
  
          String port = cl.getOptionValue("port", DEFAULT_PORT);
          String path = cl.getOptionValue("url", DEFAULT_PATH);
          String method = cl.getOptionValue("method", DEFAULT_METHOD);
  
          int timeout = DEFAULT_TIMEOUT;
          if (cl.hasOption("post")) {
              method = "POST";
          }
          boolean ssl = false;
          if (cl.hasOption("ssl") || cl.getOptionValue("certificate") != null) {
              port = cl.getOptionValue("ssl", DEFAULT_SSL_PORT);
              ssl = true;
          }
  
          if (cl.hasOption("timeout")) {
              try {
                  timeout = Integer.parseInt(cl.getOptionValue("timeout"));
              } catch (NumberFormatException e) {
                  throw new MetricGatheringException("Invalid numeric value for timeout.", Status.CRITICAL, e);
              }
          }
          if (!path.startsWith("/")) {
              path = "/" + path;
          }
          if (hostname.endsWith("/")) {
              hostname = hostname.substring(0, hostname.length() - 1);
          }
  
          long then = System.currentTimeMillis();
  
          String response = getHttpResponse(cl, hostname, port, method, path, timeout, ssl, metrics);
          int elapsed = (int) Utils.milliToSec(System.currentTimeMillis() - then);
          if (response != null) {
              metrics.addAll(analyzeResponse(cl, response, elapsed));
          }
          return metrics;
      }
docs: Execute and gather metrics.
  
  @param cl
  - The command line parameters
  @throws MetricGatheringException
  - If any error occurs during metric gathering process
  @return the gathered metrics