Re-add the history tab (store size and build time), now as lazy-loaded tab on build page.

[?]
Jan 28, 2014, 10:27 AM
VBWHG272ASPCVRBVSR7B2VXAPSSYXTWFMAN6ZV2KEQUHWLRRPYYQC

Dependencies

  • [2] GS4SFHCP templates: Use uri_for to reference static paths.
  • [3] AHTEIK7G * Added a maintainers field to the Builds table.
  • [4] LBNVQXUB * Build the /build stuff in a separate controller.
  • [5] 2QA4Y4G3 * hydra: added index, actual build time (buildstep with same outpath, so without deps) of the build
  • [6] JLICHVE6 * hydra: do not show build history if there are no previous builds
  • [7] QCGCX2BR Generalize lazy tabs
  • [8] RYLUY5ZU Do not load charts lazily for now.
  • [9] GJFYEU3S * Nix now stores logs by default as bzip2, make sure the build page uncompresses before showing.
  • [10] Y6AHH4TH Remove the logfile and logSize columns from the database
  • [11] 2R7GHSA4 * hydra: added initial version of build graph
  • [12] HPEG2RHV Merge the BuildResultInfo table into the Builds table
  • [13] PMNWRTGJ Add multiple output support
  • [14] R7MDDCB2 Some unnecessary job names
  • [15] FU4GO5VN On build pages, provide a link to the build's first eval
  • [16] L2E6EVE2 * Merged the Build and Job tables.
  • [17] 44AGCSXK Use a proper spinning wheel icon
  • [18] 36M6DGIT Show the runtime/build dependencies in the build page
  • [19] VVOAXWH4 fix wrong dbix:class:loader generation
  • [20] 3PNG7NIB Remove trailing whitespace
  • [21] ZNKPGZHF hydra: error on buildpage for queued build
  • [22] 2GUAKGTB Fix indentation of build.tt
  • [23] NW3ZYPCM added store path size graph
  • [24] ZI535LI6 * hydra: 'new' UI for project/jobset/job/build
  • [25] TCXFZZFN * hydra: make chart zoomable and clickable
  • [*] XDDCO6CH * hydra: add dependency list with links to logfiles
  • [*] J5UVLXOK * Start of a basic Catalyst web interface.
  • [*] D5QIOJGP * Move everything up one directory.

Change contents

  • replacement in src/lib/Hydra/Controller/Build.pm at line 74
    [3.272][3.2418:2451]()
    if ($build->finished && 0) {
    [3.272]
    [3.3178]
    if ($build->finished) {
  • edit in src/lib/Hydra/Controller/Build.pm at line 399
    [3.658]
    [27.1323]
    }
    sub history_graphs : Chained('buildChain') PathPart('history-graphs') {
    my ($self, $c) = @_;
    my $build = $c->stash->{build};
    if ($build->finished) {
    $c->stash->{prevBuilds} = [$c->model('DB::Builds')->search(
    { project => $c->stash->{project}->name
    , jobset => $c->stash->{build}->jobset->name
    , job => $c->stash->{build}->job->name
    , 'me.system' => $build->system
    , finished => 1
    , buildstatus => 0
    , 'me.id' => { '<=' => $build->id }
    }
    , { join => "actualBuildStep"
    , "+select" => ["actualBuildStep.stoptime - actualBuildStep.starttime"]
    , "+as" => ["actualBuildTime"]
    , order_by => "me.id DESC"
    , rows => 50
    }
    )
    ];
    }
    $c->stash->{template} = 'build-history-tab.tt';
  • replacement in src/lib/Hydra/Schema/Builds.pm at line 553
    [3.147][3.10710:10872]()
    #__PACKAGE__->has_one(
    # "actualBuildStep",
    # "Hydra::Schema::BuildSteps",
    # { 'foreign.outpath' => 'self.outpath'
    # , 'foreign.build' => 'self.id'
    # },
    #);
    [3.147]
    [3.308]
    __PACKAGE__->has_one(
    "actualBuildStep",
    "Hydra::Schema::BuildSteps",
    { 'foreign.drvpath' => 'self.drvpath'
    , 'foreign.build' => 'self.id'
    },
    );
  • file addition: build-history-tab.tt (----------)
    [29.1486]
    [% PROCESS common.tt %]
    [% PROCESS "product-list.tt" %]
    [% USE HTML %]
    [% USE Date %]
    <h3>Build time history (in seconds)</h3>
    <div id="placeholder" style="width:800px;height:400px;"></div>
    <div id="overview" style="margin-left:50px;margin-top:20px;width:600px;height:50px"></div>
    <script src="[% c.uri_for("/static/js/flot/jquery.flot.js") %]" type="text/javascript"></script>
    <script src="[% c.uri_for("/static/js/flot/jquery.flot.selection.js") %]" type="text/javascript"></script>
    <script type="text/javascript">
    $(function() {
    var d = [];
    var ids = [];
    [% FOREACH prevbuild IN prevBuilds; IF prevbuild.build.starttime != 0 %]
    d.push([[% prevbuild.starttime * 1000 %],[% prevbuild.get_column('actualBuildTime') %]]);
    ids[[% prevbuild.starttime * 1000 %]] = [% prevbuild.id %] ;
    [% END; END %]
    var options = {
    xaxis: { mode: "time" },
    selection: { mode: "x" },
    points: { show: true },
    lines: { show: true },
    grid: {
    clickable: true,
    hoverable: true,
    hoverFill: '#444',
    hoverRadius: 4,
    },
    };
    var plot = $.plot($("#placeholder"), [d], options);
    var overview = $.plot($("#overview"), [d], {
    series: {
    lines: { show: true, lineWidth: 1 },
    shadowSize: 0
    },
    xaxis: { ticks: [], mode: "time" },
    yaxis: { ticks: [], min: 0, autoscaleMargin: 0.1 },
    selection: { mode: "x" }
    });
    // now connect the two
    $("#placeholder").bind("plotselected", function (event, ranges) {
    // do the zooming
    plot = $.plot($("#placeholder"), [d],
    $.extend(true, {}, options, {
    xaxis: { min: ranges.xaxis.from, max: ranges.xaxis.to }
    }));
    // don't fire event on the overview to prevent eternal loop
    overview.setSelection(ranges, true);
    });
    $("#overview").bind("plotselected", function (event, ranges) {
    plot.setSelection(ranges);
    });
    $("#placeholder").bind("plotclick", function (e, pos, item) {
    if (item) {
    plot.highlight(item.series, item.datapoint);
    buildid = ids[item.datapoint[0]];
    window.location = "/build/"+buildid;
    }
    });
    });
    </script>
    <h3>Store path size history (in MB)</h3>
    <div id="placeholder-size" style="width:800px;height:400px;"></div>
    <div id="overview-size" style="margin-left:50px;margin-top:20px;width:600px;height:50px"></div>
    <script type="text/javascript">
    $(function() {
    var d = [];
    var ids = [];
    [% FOREACH prevbuild IN prevBuilds; IF prevbuild.size != 0 %]
    d.push([[% prevbuild.starttime * 1000 %],[% prevbuild.size / (1024*1024.0) %]]);
    ids[[% prevbuild.starttime * 1000 %]] = [% prevbuild.id %] ;
    [% END; END %]
    var options = {
    xaxis: { mode: "time" },
    selection: { mode: "x" },
    points: { show: true },
    lines: { show: true },
    grid: {
    clickable: true,
    hoverable: true,
    hoverFill: '#444',
    hoverRadius: 4,
    },
    };
    var plot = $.plot($("#placeholder-size"), [d], options);
    var overview = $.plot($("#overview-size"), [d], {
    series: {
    lines: { show: true, lineWidth: 1 },
    shadowSize: 0
    },
    xaxis: { ticks: [], mode: "time" },
    yaxis: { ticks: [], min: 0, autoscaleMargin: 0.1 },
    selection: { mode: "x" }
    });
    // now connect the two
    $("#placeholder-size").bind("plotselected", function (event, ranges) {
    // do the zooming
    plot = $.plot($("#placeholder-size"), [d],
    $.extend(true, {}, options, {
    xaxis: { min: ranges.xaxis.from, max: ranges.xaxis.to }
    }));
    // don't fire event on the overview to prevent eternal loop
    overview.setSelection(ranges, true);
    });
    $("#overview-size").bind("plotselected", function (event, ranges) {
    plot.setSelection(ranges);
    });
    $("#placeholder-size").bind("plotclick", function (e, pos, item) {
    if (item) {
    plot.highlight(item.series, item.datapoint);
    buildid = ids[item.datapoint[0]];
    window.location = "/build/"+buildid;
    }
    });
    });
    </script>
  • replacement in src/root/build.tt at line 109
    [3.2065][3.2065:2164]()
    [% IF prevBuilds %]<li><a href="#tabs-history" data-toggle="tab">History chart</a></li>[% END %]
    [3.2065]
    [3.830]
    <li><a href="#tabs-history" data-toggle="tab">History chart</a></li>
  • edit in src/root/build.tt at line 409
    [3.13191][3.20974:20975](),[3.2522][3.20974:20975](),[3.20975][3.13192:13259](),[3.13259][3.1200:1248](),[3.1248][3.13306:13472](),[3.13306][3.13306:13472](),[3.13472][3.974:975](),[3.20975][3.974:975](),[3.974][3.974:975](),[3.975][2.0:216](),[2.216][3.13651:14041](),[3.13651][3.13651:14041](),[3.14041][3.20976:20977](),[3.1039][3.20976:20977](),[3.20977][3.14042:14387](),[3.14387][3.20980:20981](),[3.1451][3.20980:20981](),[3.1807][3.20982:20983](),[3.20983][3.14388:14450](),[3.14450][3.20984:20985](),[3.1954][3.20984:20985](),[3.20985][3.14451:14785](),[3.14785][3.2093:2094](),[3.2093][3.2093:2094](),[3.2094][3.14786:14819](),[3.14819][3.270:271](),[3.270][3.270:271](),[3.271][3.14820:15111](),[3.15111][3.281:282](),[3.281][3.281:282](),[3.282][3.15112:15247](),[3.15247][3.888:889](),[3.21225][3.888:889](),[3.888][3.888:889](),[3.889][3.15248:15374](),[3.15374][3.1295:1296](),[3.1295][3.1295:1296](),[3.1296][3.15375:15685](),[3.15685][3.21226:21227](),[3.1296][3.21226:21227](),[3.21227][3.1249:1297](),[3.1297][3.15733:15909](),[3.15733][3.15733:15909](),[3.15909][3.1298:1299](),[3.1299][3.15909:16279](),[3.15909][3.15909:16279](),[3.16279][3.21228:21229](),[3.1365][3.21228:21229](),[3.21229][3.16280:16625]()
    [% IF prevBuilds %]
    <div id="tabs-history" class="tab-pane">
    <h3>Build time history (in seconds)</h3>
    <div id="placeholder" style="width:800px;height:400px;"></div>
    <div id="overview" style="margin-left:50px;margin-top:20px;width:600px;height:50px"></div>
    <script src="[% c.uri_for("/static/js/flot/jquery.flot.js") %]" type="text/javascript"></script>
    <script src="[% c.uri_for("/static/js/flot/jquery.flot.selection.js") %]" type="text/javascript"></script>
    <script type="text/javascript">
    $(function() {
    var d = [];
    var ids = [];
    [% FOREACH prevbuild IN prevBuilds; IF prevbuild.build.starttime != 0 %]
    d.push([[% prevbuild.starttime * 1000 %],[% prevbuild.get_column('actualBuildTime') %]]);
    ids[[% prevbuild.starttime * 1000 %]] = [% prevbuild.id %] ;
    [% END; END %]
    var options = {
    xaxis: { mode: "time" },
    selection: { mode: "x" },
    points: { show: true },
    lines: { show: true },
    grid: {
    clickable: true,
    hoverable: true,
    hoverFill: '#444',
    hoverRadius: 4,
    },
    };
    var plot = $.plot($("#placeholder"), [d], options);
    var overview = $.plot($("#overview"), [d], {
    series: {
    lines: { show: true, lineWidth: 1 },
    shadowSize: 0
    },
    xaxis: { ticks: [], mode: "time" },
    yaxis: { ticks: [], min: 0, autoscaleMargin: 0.1 },
    selection: { mode: "x" }
    });
    // now connect the two
    $("#placeholder").bind("plotselected", function (event, ranges) {
    // do the zooming
    plot = $.plot($("#placeholder"), [d],
    $.extend(true, {}, options, {
    xaxis: { min: ranges.xaxis.from, max: ranges.xaxis.to }
    }));
    // don't fire event on the overview to prevent eternal loop
    overview.setSelection(ranges, true);
    });
    $("#overview").bind("plotselected", function (event, ranges) {
    plot.setSelection(ranges);
    });
    $("#placeholder").bind("plotclick", function (e, pos, item) {
    if (item) {
    plot.highlight(item.series, item.datapoint);
    buildid = ids[item.datapoint[0]];
    window.location = "/build/"+buildid;
    }
    });
    });
    </script>
    <h3>Store path size history (in MB)</h3>
    <div id="placeholder-size" style="width:800px;height:400px;"></div>
    <div id="overview-size" style="margin-left:50px;margin-top:20px;width:600px;height:50px"></div>
    <script type="text/javascript">
    $(function() {
    var d = [];
    var ids = [];
    [% FOREACH prevbuild IN prevBuilds; IF prevbuild.size != 0 %]
    d.push([[% prevbuild.starttime * 1000 %],[% prevbuild.size / (1024*1024.0) %]]);
    ids[[% prevbuild.starttime * 1000 %]] = [% prevbuild.id %] ;
    [% END; END %]
    var options = {
    xaxis: { mode: "time" },
    selection: { mode: "x" },
    points: { show: true },
    lines: { show: true },
    grid: {
    clickable: true,
    hoverable: true,
    hoverFill: '#444',
    hoverRadius: 4,
    },
    };
  • replacement in src/root/build.tt at line 410
    [3.21231][3.16626:16693]()
    var plot = $.plot($("#placeholder-size"), [d], options);
    [3.21231]
    [3.21232]
    [% INCLUDE makeLazyTab tabName="tabs-history" uri=c.uri_for('/build' build.id 'history-graphs') %]
  • edit in src/root/build.tt at line 412
    [3.21233][3.16694:17033](),[3.17033][3.21234:21235](),[3.2148][3.21234:21235](),[3.21235][3.17034:17067](),[3.17067][3.21236:21237](),[3.2295][3.21236:21237](),[3.21237][3.17068:17369](),[3.17369][3.2439:2440](),[3.2439][3.2439:2440](),[3.2440][3.17370:17505](),[3.17505][3.2808:2809](),[3.2808][3.2808:2809](),[3.2809][3.17506:17637](),[3.17637][3.2819:2820](),[3.2819][3.2819:2820](),[3.2820][3.17638:17953](),[3.17953][3.21273:21274](),[3.2820][3.21273:21274](),[3.21274][3.2829:2840](),[3.2829][3.2829:2840](),[3.2840][3.1300:1313]()
    var overview = $.plot($("#overview-size"), [d], {
    series: {
    lines: { show: true, lineWidth: 1 },
    shadowSize: 0
    },
    xaxis: { ticks: [], mode: "time" },
    yaxis: { ticks: [], min: 0, autoscaleMargin: 0.1 },
    selection: { mode: "x" }
    });
    // now connect the two
    $("#placeholder-size").bind("plotselected", function (event, ranges) {
    // do the zooming
    plot = $.plot($("#placeholder-size"), [d],
    $.extend(true, {}, options, {
    xaxis: { min: ranges.xaxis.from, max: ranges.xaxis.to }
    }));
    // don't fire event on the overview to prevent eternal loop
    overview.setSelection(ranges, true);
    });
    $("#overview-size").bind("plotselected", function (event, ranges) {
    plot.setSelection(ranges);
    });
    $("#placeholder-size").bind("plotclick", function (e, pos, item) {
    if (item) {
    plot.highlight(item.series, item.datapoint);
    buildid = ids[item.datapoint[0]];
    window.location = "/build/"+buildid;
    }
    });
    });
    </script>
    </div>
    [% END %]