Skip to end of metadata
Go to start of metadata

Plugin Information

View Plot on the plugin site for more information.

2.0.0 version of the plugin brings Jenkins Pipeline support. It might break compatibility if you update from 1.X versions, as it contains some API changes. Please test in non-production environment before update.

This plugin provides generic plotting (or graphing) capabilities in Jenkins.

This plugin will plot one or more single values variations across builds in one or more plots. Plots for a particular job (or project) are configured in the job configuration screen, where each field has additional help information. Each plot can have one or more lines (called data series). After each build completes the plots' data series latest values are pulled from Java properties file(s), CSV file(s), or XML file(s) via an XPath (which you should have generated during the build) somewhere below your workspace. Data for each plot is stored in a CSV file within the job's root project directory.

It can generate various kind of plots, including Area, Bar, Line, Stacked Bar, Waterfall...

Here is an example of the plots generated by this plugin:

Configuration

Currently supported parameters

The currently supported parameters are:

  • width (int, default: 750) The width of the plot in pixels.

  • height (int, default: 750) The height of the plot in pixels.
  • rightBuildNum (int, default: 2^38 - 1) The right-most build number on the plot.
  • hasLegend (boolean, default: true) Whether or not the plot has a legend.
  • urlNumBuilds (string, default: 2^38 - 1) Number of builds back to show on this plot from URL.
  • urlTitle (string, default: "") Title of plot from URL.
  • urlStyle (string, default: "") Style of plot from URL.
  • urlUseDescr (boolean, default: false) Use description flag from URL.
  • title (string, default: "") Title of plot.
  • yaxis (string, default: "") Y-axis label.
  • series (list) List of data series.
  • group (string) Group name that this plot belongs to.
  • numBuilds (string, default:"") Number of builds back to show on this plot. An empty string means all builds. Must not be "0".
  • csvFileName (string, default: "$ROOT_DIR/plot-XXXX.csv") 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 CSVle that can be used as a source for the plot.
  • csvLastModification (long, default: "last modified date") The date of the last change to the CSV file.
  • style (string, default: "line") Style of plot: line, line3d, stackedArea, stackedBar, etc.
  • useDescr (boolean, default: false) Whether or not to use build descriptions as X-axis labels.
  • keepRecords (boolean, default: false) Keep records for builds that were deleted.
  • exclZero (boolean, default: false) Whether or not to exclude zero as default Y-axis value.
  • logarithmic (boolean, default: false) Use a logarithmic Y-axis.
  • yaxisMinimum (string, default: "") Minimum y-axis value.
  • yaxisMaximum (string, default: "") Maximum y-axis value.

For a full list of parameters the best place to view is Plot.java class.

Example Usage to generate detailed PMD reports

Attached is a Perl script which generates more detailed "summaries" out of PMD report files. We use this for several code analysis projects, all named trunk.codeanalysis.prefix.

To have all resulting plots on one page, give all Plots the same plot group. Because each code quality has its very own range, define each on a separate plot, not as an additional data series.

Pipeline job configuration

You can generate the required Scripted Pipeline syntax via the Snippet Generator by choosing the "plot: Plot build data" step.

Below you can find sample configuration which is auto-generated using Snippet Generator.

plot csvFileName: 'plot-8e54e334-ab7b-4c9f-94f7-b9d8965723df.csv', 
        csvSeries: [[
                            file: 'data.csv',
                            exclusionValues: '',
                            displayTableFlag: false,
                            inclusionFlag: 'OFF',
                            url: '']],
        group: 'Plot Group',
        title: 'Plot Title',
        style: 'line',
        exclZero: false,
        keepRecords: false,
        logarithmic: false,
        numBuilds: '',
        useDescr: false,
        yaxis: '',
        yaxisMaximum: '',
        yaxisMinimum: ''
  • csvFileName - autogenerated value, but you might want to change it to something more descriptive for your case.
  • file - source file for plot generation (relative to workspace)

JIRA issues

If you have any proposals/bug reports, please create an issue on Jenkins JIRA.

Key Summary T Created Updated Due Assignee Reporter P Status Resolution
Loading...
Refresh

Change Log

Version 2.1.0 (Jun 4, 2018) 
Version 2.0.5 (May 15, 2018) 
  • Update values table CSS style and number formatting (PR-47). 
Version 2.0.4 (May 5, 2018) 
  • Fix chart style value comparison, STACKED_AREA in particular (JENKINS-50924). 
Version 2.0.3 (January 24, 2018) 
Version 2.0.2 (January 3, 2018) 
  • Fixed ConcurrentModificationException in PlotBuildAction.java (JENKINS-48465)
  • Fixed typo's in help files (JENKINS-48530)
  • Moved plugin description to wiki (JENKINS-48537)
  • Configured Checkstyle and reformatted the project according to the rules
Version 2.0.0 (November 2, 2017) 
Version 1.11 (April 26, 2017) 
  • Final Release: includes all PRs and fixes up to now
Version 1.9 (Mar 15, 2015)
Version 1.8 (Sep 28, 2014)
Version 1.7 (Mar 11, 2014)
  • Fixed issues parsing XML files, introduced in version 1.6 (JENKINS-21493).
Version 1.6 (Jan 16, 2014)
Version 1.5 (Jul 10, 2011)
Version 1.4 (Nov 21, 2010)
Version 1.3 (Jul 20, 2010)
  • Configurable graph style for each plot.
  • Read data from XML files (JENKINS-2796).
  • Read data from CSV files (JENKINS-2899).
  • Update code for more recent Hudson.
Version 1.2 (Sep 24, 2008)

38 Comments

  1. I don't see any perl script here? How do I know what format of data file to generate?

    1. The explanation of the file format is found in configuration of the job. Click on the blue help icon for "Data series file" and you will see:

       Mandatory. Specifies the path to the Java property file (key=value pairs), relative to the workspace root, that contains the data value for this data series. The file must contain a YVALUE property and may optionally contain a URL property. If present, the URL will be opened when the data point on the plot is clicked.
      The specification of this file can use wildcards likebuild/report/*/report.properties but only the first file resolved by the wildcard will be used. See the @includes of Ant fileset for the exact format.
      For example, a properties file might look like:
        YVALUE=3.342
        URL=http://foo.bar/
      
  2. Unknown User (cbos.ec@gmail.com)

    I have 2 questions:

    • When will version 1.3 be released?
    • What format is required for XML or CSV files? It is not described in the tickets. Only properties file format is described.
  3. Is anyone maintaining this plugin?

    When will an next update be released?

  4. Unknown User (vladimir@ezono.com)

    It is not possible to adjust the plot. For example, I need a difference between builds. Is there a way to do this?

  5. Unknown User (broe@adchemy.com)

    Suggestions for version 1.4: 

    1.  Make the Plot plugin work for maven-only builds.  The "Plot build data" checkbox isn't visible on a maven-only build.

    2.  Embed the help text into this page to make it clearer how to configure the plugin.  Some working examples for CSV/XML/properties files would be great.

    3.  Add a 'debug' option that prints out some information when the data series file is being evaluated for plotting data, to help determine why each data element is or is not showing up on the plots.

  6. i would like to configure the label of the x-axis point.

    Currently only day and build number is displayed, i would like to add hour and/or minutes

  7. I would also like a "sampling every X builds" option on signle graph.
    So there will be different time slice for x-values on the same job

    1. that would be nice, or as a scatter-plot

  8. Unknown User (t1m1)

    It is possible to show the plot in the start screen of the job? Like the plot in "Tast Scanner Plugin" or "Warnings Plugin".

    Thanks for answers.

  9. 1.4 breaks my plots. The "Jump to" dropdown is now empty. The job console shows that the plots are recorded/saved though.

    Downgrading to 1.3 fixes the problem!

  10. 1.4 breaks for me just as provegard says. I see there is an open issue for this as well. Let's hope this gets resolved.

  11. Unknown User (breskeby)

    support for json docs would be nice, since I would like to query our artifactory with some custom rest calls and show them as plotted data

  12. I have a problem concerning the redirection to an URL when a point of the plot is clicked. It works under firefox (v4) but not under IE (v8). Is it normal?

  13. I really like this plug-in. I think the following would be a great addition to this plugin (or maybe create a new plugin based on this one).

    Consider the following situation. During the build process, testing takes place, code coverage is calcuated and exported to a csv file. A single csv file is used to store all the code coverage for all classes. It is easy to see that we could have hundreds of rows, one for each class. With the current Plot plugin, as far as I am aware, if I wanted to plot the code coverage for each class from the csv files, each row needs to be in a separate file and I would have to create a series or plot for each file - that is a lot of undesired configuration.

    What would be ideal, is to be able to configure the plugin to accept a multi-row csv file and specify a column with potentially unique data (like an id or class name) to use for breaking out the rows in to series.

    For example, given the following data:

    Assembly Short Name

    Coverage Quota

    AM,AMI.Common.dll

    14.1

    LabVIEWBinReader.dll

    18.4

    NITStatusDriver.dll

    70

    Trinity.NetworkManager.dll

    46.5

    If this was in a csv file, and the plot plugin was configured to use this file, plot the Coverage Quota on the y-axis, and use the Assembly Short Name as the series identifier, with one configuration we would end up with one plot with four series on it.

  14. Please, provide me with some .xml file where i can see how to create such .xml files with data for 2-3 plots in it. Like its shown on the top of the page.

  15. Are there some basic examples available? I would like to construct a plot with 2 data series namely :

    • Total overall amount of test cases in a generic project (summation of sublists of tests)
    • a horizontal line which reresents the expected number of tests as the end goal

    I want to follow up the convergeance from the actual amount of passed tests against the horizontal line.

    How would a csv or XML file look like to get this achieved?

  16. Hi.

    I would like to be able to use Plot to create a graph of the total number of a particular element in an XML feed.

    Is this possible? If so, please can you explain it to me. Thank you.  (if not, please consider this a feature request)

    Many thanks.

  17. I am using this to graph certain performance metrics, and when they are very large values such as 200,000, and the actual values are not changing much, it makes it very difficult to see how much it's changed since the last build. I would like to some functionality to be added, either an additional option to show the difference between the current build and previous build in the tool tip, or be able to hover over a point and it shows a close up version of the difference between the plots. Thank you!

  18. The exclude columns by flag does not work on jenkins. It always tries to plot all the columns from my csv file in spite of giving of a comma separated list.

    For example, my .csv file is show below:

    FP, FN, FP%, FN%

    200, 100, 20, 10

    I give FP%,FN% in the exclude list but it plots all four columns. Any solution?

  19. I am trying to extend this code to customize it. I have downloaded the source code and I am able to run it but jenkins doesnt come up with the plugin installed. Am I missing some extension points here?

    Nevermind I figured it out, I had to change Pom.xml to org.jenkins-ci.plugins version to 1.480.3

  20. Installed 1.5 on Jenkins 1.520. Don't have "Plot build data" in "Add post-build action" menu.

  21. I'm trying to change the colors in the plugin, so I imported it to Eclipse.
    The Project is full of errors and won't build.

    What can I do?

  22. Has anyone found a way to set the line colours?

    1. i would like to set colors too.

  23. I really like this tool and use it for plotting values for different job runs.  In the graph, I am not able to keep a close tab on the exact value and was thinking it would be good to have a tabular format instead of plotting.  Is there a way to put the data from job runs into tabular form instead of plotting it in a graph?

  24. This is a great plugin.

    Is it possible to display a plot on a Dashboard View?

    This could be possible if there is a URL to the latest plot that I can put in a iframe. Otherwise can I request this as a feature?

    1. if you right click the plot image, and copy image url, it gives a URL "to the latest plot" like you want.  Such that the image on a site stays up to date with the latest plot.

  25. I bothers me a lot that the area style of chart drops to 0 at the right edge, instead of ending with the latest value(s).

  26. I forked this and made the chart display above the table, and the values in the table reverse in order so that the latest build shows up at the top. I am using this in conjunction with software that is carrying out automated performance tests, and these were set to run frequently resulting in a pretty lengthy table. As such it just ended up displaying better this way, as otherwise if I wanted to see the chart I would need to scroll all the way down and subsequently lose sight of the build pass/fail.

    Agreed with earlier postings that support for JSON as input (with options controlling what should be plotted) would be handy as I had to do some annoying conversions in order to get the right CSV format. That or multi-line CSV as this is what I originally was hoping to be able to do.

    It took me a while to find it, so for the benefit of others, the CSV format is like this:

    "series 1","series 2","series 3","series 4"
    
    "5.04","15.04","96","10.05"
    

    Some characters in the series names don't come out in the table, e.g. < and >, but display fine in the legend label.

  27. Is there any way of not updating the plot data if the build fails or if it is aborted?

  28. It seems that you can only set 1 'CSV Exclusion values'/ 'URL', if you have multiple Data Series or multiple Ploys. Is this a bug or am i doing something wrong?

  29. Is it possible to use this plugin with pipeline? Can someone please point me to an example?

  30. Could anyone point out to sample pipeline script? I can't seem to get this one working anyhow.

    org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
    WorkflowScript: 6: Missing required parameter: "propertiesSeries" @ line 6, column 17.
                       plot csvFileName: '
    1. (Sample script included in wiki page, see above)

      Dusan Maksic have you tried to generate pipeline script using Snippet Generator

      1. Veaceslav Gaidarji   Thanks for the quick reply. Yes, I have, and I have found the reason for problems in the meantime.

        One problem was not having "plot ..." snippet within script { } part in declarative pipeline syntax (the log I have previously put).

        The other problem was having .csv generated by localized version of LibreOffice, and thus having "exception in converting value..." message displayed, where table would be displayed, but plot would be missing.

        Anyway, thanks for the good work and pipeline support update. Cheers!

        1. Dusan Maksic Glad it worked for you. I have updated the wiki page to explicitly mention which pipeline syntax is supported.

  31. is it possible to plot data for current build only?

    for example i have gathered some CPU useage over time during build #1

    and i wanna plot that in a line chart, but all i am getting is a vertical line