40

Is there a plugin which would allow me to create a "trend" graph for a hudson build which shows the build time for that project?

I'm tasked with speeding up the build and I'd like to show a nice trend as I speed it up.

akjoshi
  • 15,374
  • 13
  • 103
  • 121
SamBeran
  • 1,944
  • 2
  • 17
  • 24

3 Answers3

90

This is supported out of the box: http://SERVER/hudson/job/JOBNAME/buildTimeTrend

enter image description here

SuperBiasedMan
  • 9,814
  • 10
  • 45
  • 73
Pascal Thivent
  • 562,542
  • 136
  • 1,062
  • 1,124
  • 2
    Just in case, it's the link "(trend") next to "Build History" on the left side in the box. – mark Mar 01 '10 at 11:59
  • 1
    It's just a shame this is just for the builds in your history. It would be nice if it recorded a number of trends like 1 year, month etc.. Thanks for the answer – Shawn Vader Jan 31 '12 at 14:07
  • Unfortunately the graph only shows 20 builds. https://issues.jenkins-ci.org/browse/JENKINS-22008 – yoyo May 05 '17 at 17:21
18

To follow up from the @Pascal's answer, if you would like to bring this graph and show it more prominently you can edit the job description and add an image directly there

<img src="http://test.vlc/job/flow_tester/buildTimeGraph/png" />

That way you can see the time trend every time you open the job.

enter image description here

SuperBiasedMan
  • 9,814
  • 10
  • 45
  • 73
Jamie Cook
  • 4,375
  • 3
  • 42
  • 53
  • is it possible to configure the look of the PNG image? instead of the build number on the x-axis, i'd like to see the build host... – dokaspar Oct 09 '14 at 06:15
  • Sorry @Dominik my answer was more about how to get the default image more prominently displayed. – Jamie Cook Oct 13 '14 at 03:29
7

To follow up from the @Jamie Cooks's answer, you don't need to provide full url for this graph, you can just use the relative path like this in your job description -

<img src='buildTimeGraph/png' />

Benefit of this is that you don't need to change/customize the url for each job.

Moreover, to enable this on all your jobs you can use this groovy script

import hudson.model.*
import hudson.maven.*
import hudson.tasks.*

for(item in Hudson.instance.items) 
{
  println("job $item.name")
  item.setDescription("<img src='buildTimeGraph/png' />");
}
akjoshi
  • 15,374
  • 13
  • 103
  • 121