public void publishAfterBuildArtifactFile()

in dotTrace-agent/src/main/java/jetbrains/buildServer/dotTrace/agent/BuildPublisher.java [43:69]


  public void publishAfterBuildArtifactFile(@NotNull final CommandLineExecutionContext commandLineExecutionContext, @NotNull final File reportFile) {
    myAfterBuildPublisher.publishAfterBuildArtifactFile(commandLineExecutionContext, reportFile);

    Metrics thresholdValues;
    String thresholdsStr = myParametersService.tryGetRunnerParameter(Constants.THRESHOLDS_VAR);
    if(!StringUtil.isEmptyOrSpaces(thresholdsStr)) {
      thresholdValues = myThresholdsParser.parse(thresholdsStr);
    }
    else {
      return;
    }

    try {
      final String reportContent = myFileService.readAllTextFile(reportFile);
      final Metrics measuredValues = myReportParser.parse(reportContent);
      for (Metric measuredValue : measuredValues.getMetrics()) {
        for (final Metric thresholdValue : thresholdValues.getMetrics()) {
          if(measuredValue.getMethodName().startsWith(thresholdValue.getMethodName())) {
            myLoggerService.onMessage(new StatisticMessage(measuredValue.getMethodName(), thresholdValue.getTotalTime(), thresholdValue.getOwnTime(), measuredValue.getTotalTime(), measuredValue.getOwnTime()));
          }
        }
      }
    }
    catch (IOException e) {
      throw new BuildException(e.getMessage());
    }
  }