code: private List<Metric> analyzeResponse(final ICommandLine opt, final String response, final int elapsed) throws MetricGatheringException {
          List<Metric> metrics = new ArrayList<Metric>();
          metrics.add(new Metric("time", "", new BigDecimal(elapsed), null, null));
  
          if (!opt.hasOption("certificate")) {
              if (opt.hasOption("string")) {
                  boolean found = false;
                  String string = opt.getOptionValue("string");
                  found = response.contains(string);
                  metrics.add(new Metric("string", "", new BigDecimal(Utils.getIntValue(found)), null, null));
              }
              if (opt.hasOption("expect")) {
                  int count = 0;
                  String[] values = opt.getOptionValue("expect").split(",");
                  for (String value : values) {
                      if (response.contains(value)) {
                          count++;
                      }
                  }
                  metrics.add(new Metric("expect", String.valueOf(count) + " times. ", new BigDecimal(count), null, null));
              }
              if (opt.hasOption("regex")) {
                  String regex = opt.getOptionValue("regex");
                  Pattern p = null;
                  int flags = 0;
                  if (opt.hasOption("eregi")) {
                      flags = Pattern.CASE_INSENSITIVE;
                  }
                  if (opt.hasOption("linespan")) {
                      flags = flags | Pattern.MULTILINE;
                  }
                  p = Pattern.compile(regex, flags);
                  boolean found = p.matcher(response).find();
                  if (opt.hasOption("invert-regex")) {
                      metrics.add(new Metric("invert-regex", String.valueOf(found), new BigDecimal(Utils.getIntValue(found)), null, null));
                  } else {
                      metrics.add(new Metric("regex", String.valueOf(found), new BigDecimal(Utils.getIntValue(found)), null, null));
                  }
              }
          }
          return metrics;
      }
docs: Apply logic to the http response and build metrics.
  
  @param opt
  -
  @param response
  -
  @param elapsed
  -
  @return - The metrics
  @throws MetricGatheringException
  List<Metric>