Package hudson.plugins.plot
Class Plot
- java.lang.Object
-
- hudson.plugins.plot.Plot
-
- All Implemented Interfaces:
Comparable<Plot>
public class Plot extends Object implements 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
Fields Modifier and Type Field Description String
csvFileName
The name of the CSV file that persists the plots data.String
description
Description of plot.boolean
exclZero
Whether or not to exclude zero as default Y-axis value.String
group
Group name that this plot belongs to.boolean
logarithmic
Use a logarithmic Y-axis.String
numBuilds
Number of builds back to show on this plot.List<Series>
series
List of data series.String
style
Optional style of plot: line, line3d, stackedArea, stackedBar, etc.String
title
Title of plot.String
urlNumBuilds
Number of builds back to show on this plot from url.String
urlStyle
Style of plot from url.String
urlTitle
Title of plot from url.Boolean
urlUseDescr
Use description flag from url.boolean
useDescr
Whether or not to use build descriptions as X-axis labels.String
yaxis
Y-axis label.String
yaxisMaximum
String
yaxisMinimum
Min/max yaxis values, string used so if no value defaults used
-
Constructor Summary
Constructors Constructor Description Plot()
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
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addBuild(AbstractBuild<?,?> build, PrintStream logger)
void
addBuild(Run<?,?> run, PrintStream logger, FilePath workspace)
Called when a build completes.int
compareTo(Plot o)
boolean
equals(Object o)
String
getCsvFileName()
String
getDescription()
Double
getDoubleFromString(String input)
boolean
getExclZero()
String
getGroup()
Job<?,?>
getJob()
boolean
getKeepRecords()
String
getNumBuilds()
AbstractProject<?,?>
getProject()
Deprecated.List<Series>
getSeries()
String
getTitle()
String
getURLNumBuilds()
String
getYaxis()
Double
getYaxisMaximum()
Double
getYaxisMinimum()
int
hashCode()
boolean
hasLegend()
boolean
hasYaxisMaximum()
boolean
hasYaxisMinimum()
boolean
isLogarithmic()
void
plotGraph(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
Generates and writes the plot to the response output stream.void
plotGraphMap(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
Generates and writes the plot's clickable map to the response output stream.void
setJob(Job<?,?> job)
void
setProject(AbstractProject<?,?> project)
A reference to the project is needed to retrieve the project's root directory where the CSV file is located.String
toString()
-
-
-
Field Detail
-
urlNumBuilds
public transient String urlNumBuilds
Number of builds back to show on this plot from url.
-
urlTitle
public transient String urlTitle
Title of plot from url.
-
urlStyle
public transient String urlStyle
Style of plot from url.
-
urlUseDescr
public transient Boolean urlUseDescr
Use description flag from url.
-
title
public String title
Title of plot. Mandatory.
-
description
public String description
Description of plot. Optional.
-
yaxis
public String yaxis
Y-axis label. Optional.
-
group
public String group
Group name that this plot belongs to.
-
numBuilds
public String numBuilds
Number of builds back to show on this plot. Empty string means all builds. Must not be "0".
-
csvFileName
public String 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
public String style
Optional style of plot: line, line3d, stackedArea, stackedBar, etc.
-
useDescr
public boolean useDescr
Whether or not to use build descriptions as X-axis labels. Optional.
-
exclZero
public boolean exclZero
Whether or not to exclude zero as default Y-axis value. Optional.
-
logarithmic
public boolean logarithmic
Use a logarithmic Y-axis.
-
yaxisMinimum
public String yaxisMinimum
Min/max yaxis values, string used so if no value defaults used
-
yaxisMaximum
public String yaxisMaximum
-
-
Constructor Detail
-
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 Detail
-
getKeepRecords
public boolean getKeepRecords()
-
getExclZero
public boolean getExclZero()
-
isLogarithmic
public boolean isLogarithmic()
-
hasYaxisMinimum
public boolean hasYaxisMinimum()
-
getYaxisMinimum
public Double getYaxisMinimum()
-
hasYaxisMaximum
public boolean hasYaxisMaximum()
-
getYaxisMaximum
public Double getYaxisMaximum()
-
compareTo
public int compareTo(Plot o)
- Specified by:
compareTo
in interfaceComparable<Plot>
-
getYaxis
public String getYaxis()
-
getGroup
public String getGroup()
-
getCsvFileName
public String getCsvFileName()
-
getTitle
public String getTitle()
-
hasLegend
public boolean hasLegend()
-
getURLNumBuilds
public String getURLNumBuilds()
-
getNumBuilds
public String getNumBuilds()
-
getDescription
public String getDescription()
-
getJob
public Job<?,?> getJob()
-
setJob
public void setJob(Job<?,?> job)
-
getProject
@Deprecated public AbstractProject<?,?> getProject()
Deprecated.
-
setProject
public void setProject(AbstractProject<?,?> project)
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.StaplerRequest req, org.kohsuke.stapler.StaplerResponse 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.StaplerRequest req, org.kohsuke.stapler.StaplerResponse 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
public void addBuild(AbstractBuild<?,?> build, PrintStream logger)
- See Also:
addBuild(Run, PrintStream, FilePath)
-
addBuild
public void addBuild(Run<?,?> run, PrintStream logger, FilePath workspace)
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.
-
-