flot

Fuego uses the Javascript 'flot' package to plot data in the Jenkins interface. See Jenkins Visualization

Cogent originally wrote the flot plugin for Jenkins, by adding the Java wrapper code and javascript in mod.js and CSS in my.css for the code for plots.

flot is written using jQuery.

The flot plugin consists of:

The source for this is in:

This is used to create a flot.hpi, which is installed into Jenkins during the docker container build for Fuego.

Inside the container, this stuff lives in /var/lib/jenkins/plugins/flot:

The floatingBox.jelly file looks like this:

Jenkins url notes [edit section]

The base url for Jenkins as configured by Fuego is: http://localhost:8080/fuego

The URL for a job page is: http://localhost:8080/fuego/job/bbb.default.Benchmark.Dhrystone/

flot base [edit section]

Here are the files in the flot base:

Fuego extension [edit section]

The HTML on the job page has:
<div style="float:right">
    <script src="/fuego/plugin/flot/flot/jquery.min.js" language="javascript" type="text/javascript"></script>
    <script src="/fuego/plugin/flot/flot/jquery.flot.min.js" language="javascript" type="text/javascript"></script>
    <script src="/fuego/plugin/flot/flot/jquery.flot.navigate.min.js" language="javascript" type="text/javascript"></script>
    <script src="/fuego/plugin/flot/flot/jquery.flot.symbol.min.js" language="javascript" type="text/javascript"></script>
    <script src="/fuego/plugin/flot/flot/jquery.flot.selection.min.js" language="javascript" type="text/javascript"></script>
    <script src="/fuego/plugin/flot/flot/canvas2image.js" language="javascript" type="text/javascript"></script>
    <script src="/fuego/plugin/flot/flot/base64.js" language="javascript" type="text/javascript"></script>
    <link rel="stylesheet" type="text/css" href="/fuego/plugin/flot/flot/my.css" />
    <div>
        <div id="mod">
            <script src="/fuego/plugin/flot/flot/mod.js" language="javascript" type="text/javascript"></script>
        </div>
    <div class="plots">
    </div>
</div>

This is put there by ChartAction.java using the following "jelly" file: The source is:

(In general, Jenkins interface glue pieces are described as "jelly")

The mod.js code will populate the <div> that is of class "plots" with the output for this job.

mod.js - JTA [edit section]

Here are teh functions in mod.js script for JTA:

Data files used:

mod.js - 1.1 [edit section]

Here are the functions in the mod.js script for Fuego 1.0

Here are the files used by mod.js to get the plot data:

Here's are some example files used: metrics.json (for Benchmark.Dhrystone):

Benchmark.Dhrystone.info.json

Benchmark.Dhrystone.Dhrystone.json

mod.js - 1.2 [edit section]

Here are the files used by the mod.js to get the plot data:

jQuery(location) URL parts is put into array localurl and testtype (e.g. Functional or Benchmark) and testsuite (e.g. Dhrystone) are extracted from it.

A hidden tooltip object is created and added to the page body.

Functions:

Thread of execution:

Here are some example files:

results.json (Fuego 1.1-pre-April)

Benchmark.Dhrystone results.json (Fuego 1.2-pre-August)

flot API [edit section]

Per plot, flot expects:

example:

[ { label: "Foo", data: [ [10, 1], [17, -14], [30, 5] ] },
  { label: "Bar", data: [ [11, 13], [19, 11], [30, -7] ] }
]

Also, you can specify a config per plot, with lots of details about how to draw the plot. See https://github.com/flot/flot/blob/master/API.md