From 5f474b252c0fc2cb77ba145be798a0d438c8a098 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 7 Oct 2014 11:23:15 +0200 Subject: [PATCH] Add a chart to the job pages showing the closure size over time --- src/lib/Hydra/Controller/Job.pm | 9 ++++ src/root/common.tt | 6 +++ src/root/job.tt | 85 +++++++++++++++++++++++++++++++++ 3 files changed, 100 insertions(+) diff --git a/src/lib/Hydra/Controller/Job.pm b/src/lib/Hydra/Controller/Job.pm index db2a2333..def78c0a 100644 --- a/src/lib/Hydra/Controller/Job.pm +++ b/src/lib/Hydra/Controller/Job.pm @@ -80,6 +80,15 @@ sub overview : Chained('job') PathPart('') Args(0) { } +sub closure_sizes : Chained('job') PathPart('closure-sizes') Args(0) { + my ($self, $c) = @_; + my @res = $c->stash->{job}->builds->search( + { finished => 1, buildstatus => 0, closuresize => { '!=', 0 } }, + { order_by => "id", columns => [ "id", "timestamp", "closuresize" ] }); + $self->status_ok($c, entity => [ map { { id => $_->id, timestamp => $_ ->timestamp, value => $_->closuresize } } @res ]); +} + + # Hydra::Base::Controller::ListBuilds needs this. sub get_builds : Chained('job') PathPart('') CaptureArgs(0) { my ($self, $c) = @_; diff --git a/src/root/common.tt b/src/root/common.tt index 8a108867..6300bdd9 100644 --- a/src/root/common.tt +++ b/src/root/common.tt @@ -527,4 +527,10 @@ BLOCK renderJobsetOverview %] [% END; +BLOCK includeFlot %] + + +[% END; + + %] diff --git a/src/root/job.tt b/src/root/job.tt index bce2b7d7..1905faf1 100644 --- a/src/root/job.tt +++ b/src/root/job.tt @@ -5,6 +5,8 @@ [% PROCESS common.tt %] [% hideProjectName=1 hideJobsetName=1 hideJobName=1 %] +[% INCLUDE includeFlot %] + [% IF !jobExists(job) %]
This job is not a member of the Constituents [% END %] +
  • Charts
  • Links
  • @@ -81,6 +84,88 @@ removed or had an evaluation error.
    [% END %] +
    + +

    Closure size (in MiB)

    + +
    +
    + + + +
    +