/**
  * this method returns a formatted string that contains the total scenarios run. if there were
  * ignored scenarios, the total number is determined by subtracting the ignored ones; thus, we
  * don't convey that an ignored scenario was "run"
  */
 private String getScenariosRunMessage(final ResultsReporter results) {
   if (results.getIgnoredScenarioCount() > 0) {
     return "Scenarios run: ("
         + +(results.getScenarioCount() - results.getIgnoredScenarioCount())
         + " of "
         + results.getScenarioCount()
         + ")";
   } else {
     return "Scenarios run: " + results.getScenarioCount();
   }
 }
  private void printMetrics(
      final Behavior behavior,
      final long startTime,
      final ResultsReporter results,
      final long endTime) {

    if (behavior instanceof Story) {
      System.out.println(
          (results.getFailedScenarioCount() == 0 ? "" : "FAILURE ")
              + this.getScenariosRunMessage(results)
              + ", Failures: "
              + results.getFailedScenarioCount()
              + ", Pending: "
              + results.getPendingScenarioCount()
              + (results.getIgnoredScenarioCount() > 0
                  ? ", Ignored: " + results.getIgnoredScenarioCount()
                  : "")
              + ", Time elapsed: "
              + (endTime - startTime) / 1000f
              + " sec\n");
    } else {
      System.out.println(
          (results.getFailedSpecificationCount() == 0 ? "" : "FAILURE ")
              + "Specifications run: "
              + results.getSpecificationCount()
              + ", Failures: "
              + results.getFailedSpecificationCount()
              + ", Pending: "
              + results.getPendingSpecificationCount()
              + ", Time elapsed: "
              + (endTime - startTime) / 1000f
              + " sec");
    }

    if (results.getFailedBehaviorCount() > 0) {
      handleFailurePrinting(results.getGenesisStep());
    }
  }