Package hudson.plugins.plot
Class Plot
java.lang.Object
hudson.plugins.plot.Plot
- All Implemented Interfaces:
Comparable<Plot>
Represents the configuration for a single plot. A plot can have one or more
data series (lines). Each data series has one data point per build. The
x-axis is always the build number.
A plot has the following characteristics:
- a title (mandatory)
- y-axis label (defaults to no label)
- one or more data series
- plot group (defaults to no group)
- number of builds to show on the plot (defaults to all)
A plots group effects the way in which plots are displayed. Group names are listed as links on the top-level plot page. The user then clicks on a group and sees the plots that belong to that group.
- Author:
- Nigel Daley
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe name of the CSV file that persists the plots data.Description of plot.boolean
Whether or not to exclude zero as default Y-axis value.Group name that this plot belongs to.boolean
Use a logarithmic Y-axis.Number of builds back to show on this plot.List of data series.Optional style of plot: line, line3d, stackedArea, stackedBar, etc.Title of plot.Number of builds back to show on this plot from url.Style of plot from url.Title of plot from url.Use description flag from url.boolean
Whether or not to use build descriptions as X-axis labels.Y-axis label.Min/max yaxis values, string used so if no value defaults used -
Constructor Summary
ConstructorsConstructorDescriptionPlot()
Plot
(String title, String yaxis, String group, String numBuilds, String csvFileName, String style, boolean useDescr) Deprecated.Kept for backward compatibility.Plot
(String title, String yaxis, String group, String numBuilds, String csvFileName, String style, boolean useDescr, boolean keepRecords, boolean exclZero, boolean logarithmic, String yaxisMinimum, String yaxisMaximum, String description) Creates a new plot with the given parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addBuild
(AbstractBuild<?, ?> build, PrintStream logger) void
addBuild
(Run<?, ?> run, PrintStream logger, FilePath workspace) Called when a build completes.int
boolean
getDoubleFromString
(String input) boolean
getGroup()
Job<?,
?> getJob()
boolean
AbstractProject<?,
?> Deprecated.getTitle()
getYaxis()
int
hashCode()
boolean
boolean
boolean
boolean
void
plotGraph
(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) Generates and writes the plot to the response output stream.void
plotGraphMap
(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) Generates and writes the plot's clickable map to the response output stream.void
void
setProject
(AbstractProject<?, ?> project) A reference to the project is needed to retrieve the project's root directory where the CSV file is located.toString()
-
Field Details
-
urlNumBuilds
Number of builds back to show on this plot from url. -
urlTitle
Title of plot from url. -
urlStyle
Style of plot from url. -
urlUseDescr
Use description flag from url. -
title
Title of plot. Mandatory. -
description
Description of plot. Optional. -
yaxis
Y-axis label. Optional. -
series
List of data series. -
group
Group name that this plot belongs to. -
numBuilds
Number of builds back to show on this plot. Empty string means all builds. Must not be "0". -
csvFileName
The name of the CSV file that persists the plots data. The CSV file is stored in the projects root directory. This is different from the source csv file that can be used as a source for the plot. -
style
Optional style of plot: line, line3d, stackedArea, stackedBar, etc. -
useDescr
public boolean useDescrWhether or not to use build descriptions as X-axis labels. Optional. -
exclZero
public boolean exclZeroWhether or not to exclude zero as default Y-axis value. Optional. -
logarithmic
public boolean logarithmicUse a logarithmic Y-axis. -
yaxisMinimum
Min/max yaxis values, string used so if no value defaults used -
yaxisMaximum
-
-
Constructor Details
-
Plot
@DataBoundConstructor public Plot(String title, String yaxis, String group, String numBuilds, String csvFileName, String style, boolean useDescr, boolean keepRecords, boolean exclZero, boolean logarithmic, String yaxisMinimum, String yaxisMaximum, String description) Creates a new plot with the given parameters. If numBuilds is the empty string, then all builds will be included. Must not be zero. -
Plot
@Deprecated public Plot(String title, String yaxis, String group, String numBuilds, String csvFileName, String style, boolean useDescr) Deprecated.Kept for backward compatibility. -
Plot
public Plot()
-
-
Method Details
-
getKeepRecords
public boolean getKeepRecords() -
getExclZero
public boolean getExclZero() -
isLogarithmic
public boolean isLogarithmic() -
hasYaxisMinimum
public boolean hasYaxisMinimum() -
getYaxisMinimum
-
hasYaxisMaximum
public boolean hasYaxisMaximum() -
getYaxisMaximum
-
getDoubleFromString
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Plot>
-
equals
-
hashCode
public int hashCode() -
toString
-
getYaxis
-
getSeries
-
getGroup
-
getCsvFileName
-
getTitle
-
hasLegend
public boolean hasLegend() -
getURLNumBuilds
-
getNumBuilds
-
getDescription
-
getJob
-
setJob
-
getProject
Deprecated. -
setProject
A reference to the project is needed to retrieve the project's root directory where the CSV file is located. Unfortunately, a reference to the project is not available when this object is created. -
plotGraph
public void plotGraph(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException Generates and writes the plot to the response output stream.- Parameters:
req
- the incoming requestrsp
- the response stream- Throws:
IOException
-
plotGraphMap
public void plotGraphMap(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException Generates and writes the plot's clickable map to the response output stream.- Parameters:
req
- the incoming requestrsp
- the response stream- Throws:
IOException
-
addBuild
- See Also:
-
addBuild
Called when a build completes. Adds the finished build to this plot. This method extracts the data for each data series from the build and saves it in the plot's CSV file.
-