From 0bb027e633af28a740ba1bca6c5cd4cfaf2d5a26 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 7 Oct 2014 11:45:17 +0200 Subject: [PATCH] Move the store path size chart to the job page The history is a property of the job, not individual builds. --- src/lib/Hydra/Controller/Job.pm | 9 ++++ src/root/build-history-tab.tt | 68 --------------------------- src/root/common.tt | 81 +++++++++++++++++++++++++++++++++ src/root/job.tt | 76 ++----------------------------- 4 files changed, 93 insertions(+), 141 deletions(-) diff --git a/src/lib/Hydra/Controller/Job.pm b/src/lib/Hydra/Controller/Job.pm index def78c0a..aa708bb2 100644 --- a/src/lib/Hydra/Controller/Job.pm +++ b/src/lib/Hydra/Controller/Job.pm @@ -89,6 +89,15 @@ sub closure_sizes : Chained('job') PathPart('closure-sizes') Args(0) { } +sub output_sizes : Chained('job') PathPart('output-sizes') Args(0) { + my ($self, $c) = @_; + my @res = $c->stash->{job}->builds->search( + { finished => 1, buildstatus => 0, size => { '!=', 0 } }, + { order_by => "id", columns => [ "id", "timestamp", "size" ] }); + $self->status_ok($c, entity => [ map { { id => $_->id, timestamp => $_ ->timestamp, value => $_->size } } @res ]); +} + + # Hydra::Base::Controller::ListBuilds needs this. sub get_builds : Chained('job') PathPart('') CaptureArgs(0) { my ($self, $c) = @_; diff --git a/src/root/build-history-tab.tt b/src/root/build-history-tab.tt index bef3af62..8d274f71 100644 --- a/src/root/build-history-tab.tt +++ b/src/root/build-history-tab.tt @@ -71,71 +71,3 @@ }); }); - -

Store path size history (in MB)

- -
-
- - - - diff --git a/src/root/common.tt b/src/root/common.tt index 6300bdd9..946c88ae 100644 --- a/src/root/common.tt +++ b/src/root/common.tt @@ -533,4 +533,85 @@ BLOCK includeFlot %] [% END; +BLOCK createChart %] + +
+
+ + + +[% END; + + %] diff --git a/src/root/job.tt b/src/root/job.tt index 1905faf1..de2d2655 100644 --- a/src/root/job.tt +++ b/src/root/job.tt @@ -88,81 +88,11 @@ removed or had an evaluation error.

Closure size (in MiB)

-
-
+ [% INCLUDE createChart id="closure-size" dataUrl=c.uri_for('/job' project.name jobset.name job.name 'closure-sizes') %] - + [% INCLUDE createChart id="output-size" dataUrl=c.uri_for('/job' project.name jobset.name job.name 'output-sizes') %]