hudson.plugins.findbugs.util
Class HealthReportBuilder

java.lang.Object
  extended by hudson.plugins.findbugs.util.HealthReportBuilder
All Implemented Interfaces:
java.io.Serializable

public class HealthReportBuilder
extends java.lang.Object
implements java.io.Serializable

Creates a health report for integer values based on healthy and unhealthy thresholds.

Author:
Ulli Hafner
See Also:
HealthReport, Serialized Form

Constructor Summary
HealthReportBuilder(AbstractHealthDescriptor healthDescriptor)
          Creates a new instance of HealthReportBuilder.
 
Method Summary
 hudson.model.HealthReport computeHealth(AnnotationProvider result)
          Computes the healthiness of a build based on the specified results.
protected  hudson.model.HealthReport computeHealth(int counter, AnnotationProvider result)
          Computes the healthiness of a build based on the specified counter.
 org.jfree.chart.JFreeChart createGraph(boolean useHealthBuilder, java.lang.String url, org.jfree.data.category.CategoryDataset dataset, ToolTipProvider toolTipProvider)
          Creates a trend graph for the corresponding action using the thresholds of this health builder.
 java.util.List<java.lang.Integer> createSeries(int totalCount)
          Creates a list of integer values used to create a three color graph showing the items per build.
 boolean isEnabled()
          Returns whether this health report build is enabled, i.e. at least one of the health or failed thresholds are provided.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HealthReportBuilder

public HealthReportBuilder(AbstractHealthDescriptor healthDescriptor)
Creates a new instance of HealthReportBuilder.

Parameters:
healthDescriptor - health descriptor
Method Detail

computeHealth

public hudson.model.HealthReport computeHealth(AnnotationProvider result)
Computes the healthiness of a build based on the specified results. Reports a health of 100% when the specified counter is less than healthy. Reports a health of 0% when the specified counter is greater than unHealthy. The computation takes only annotations of the specified severity into account.

Parameters:
result - annotations of the current build
Returns:
the healthiness of a build

computeHealth

protected hudson.model.HealthReport computeHealth(int counter,
                                                  AnnotationProvider result)
Computes the healthiness of a build based on the specified counter. Reports a health of 100% when the specified counter is less than healthy. Reports a health of 0% when the specified counter is greater than unHealthy.

Parameters:
counter - the number of items in a build that should be considered for health computation
result - annotations of the current build
Returns:
the healthiness of a build

isEnabled

public boolean isEnabled()
Returns whether this health report build is enabled, i.e. at least one of the health or failed thresholds are provided.

Returns:
true if health or failed thresholds are provided

createSeries

public java.util.List<java.lang.Integer> createSeries(int totalCount)
Creates a list of integer values used to create a three color graph showing the items per build.

Parameters:
totalCount - total number of items
Returns:
the list of values

createGraph

public org.jfree.chart.JFreeChart createGraph(boolean useHealthBuilder,
                                              java.lang.String url,
                                              org.jfree.data.category.CategoryDataset dataset,
                                              ToolTipProvider toolTipProvider)
Creates a trend graph for the corresponding action using the thresholds of this health builder.

Parameters:
useHealthBuilder - if the health thresholds should be used at all
url - the URL shown in the tool tips
dataset - the data set of the values to render
toolTipProvider - tooltip provider for the clickable map
Returns:
the created graph


Copyright © 2008. All Rights Reserved.