From patchwork Tue Jul 2 09:31:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stevan Radakovic X-Patchwork-Id: 18230 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f69.google.com (mail-yh0-f69.google.com [209.85.213.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 210D125E04 for ; Tue, 2 Jul 2013 09:41:17 +0000 (UTC) Received: by mail-yh0-f69.google.com with SMTP id b12sf8523263yha.8 for ; Tue, 02 Jul 2013 02:41:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-beenthere:x-forwarded-to:x-forwarded-for:delivered-to :mime-version:x-launchpad-project:x-launchpad-branch :x-launchpad-message-rationale:x-launchpad-branch-revision-number :x-launchpad-notification-type:to:from:subject:message-id:date :reply-to:sender:errors-to:precedence:x-generated-by :x-launchpad-hash:x-gm-message-state:x-original-sender :x-original-authentication-results:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=phz8I0alofG574O5JhBdpHvaPo2pvMZvSTTw2BON7sQ=; b=Iu2yUKf9+mSPwCfjFtWIu4wZFhYqQgjbj4teuBW5ivkULvF4zV2GTfhE2ewjUtjCx9 hdofbXCeEJHHPiu8uWuHvcewdqK1BVtBFb+lWSBQBeZrUwGyGxGK/ObEL00D8bfvMCj2 o3rMBJGjc0+h+HEqipgQ/2TQDWygzRA+wlCfFgGt9nTcUHyIpsr+mouKa+CygADijNas OZa//HFp49g7OfcyCRzLrfKPA30DNAJ4W6A6A4kizFxmpJElBsSOmXqq35DEcLGeN447 s79VEomZ+jrRku0kZn5l829G7uAMVpMDVYE0RjU7YiahSFudqMFS5d39ev57DC+hVuQu 1lvw== X-Received: by 10.236.119.227 with SMTP id n63mr7104162yhh.38.1372758076662; Tue, 02 Jul 2013 02:41:16 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.128.137 with SMTP id no9ls2471858qeb.82.gmail; Tue, 02 Jul 2013 02:41:16 -0700 (PDT) X-Received: by 10.52.120.7 with SMTP id ky7mr9195803vdb.12.1372758076511; Tue, 02 Jul 2013 02:41:16 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id k4si36905vdi.119.2013.07.02.02.41.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 02 Jul 2013 02:41:16 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id hr11so2635142vcb.34 for ; Tue, 02 Jul 2013 02:41:16 -0700 (PDT) X-Received: by 10.58.215.200 with SMTP id ok8mr11070805vec.21.1372758076359; Tue, 02 Jul 2013 02:41:16 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.165.8 with SMTP id yu8csp3224veb; Tue, 2 Jul 2013 02:41:15 -0700 (PDT) X-Received: by 10.194.174.38 with SMTP id bp6mr23300108wjc.83.1372758075313; Tue, 02 Jul 2013 02:41:15 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id yo8si7903094wjc.56.2013.07.02.02.41.14 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 02 Jul 2013 02:41:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1Utx5F-00037x-VN for ; Tue, 02 Jul 2013 09:41:13 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 641A7E0A00 for ; Tue, 2 Jul 2013 09:31:13 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: lava-dashboard X-Launchpad-Branch: ~linaro-validation/lava-dashboard/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 410 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dashboard/trunk] Rev 410: Introduce new plot-by-measurements on Image Reports page. Reviewed by tyler-baker. Message-Id: <20130702093113.30798.4411.launchpad@ackee.canonical.com> Date: Tue, 02 Jul 2013 09:31:13 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: list X-Generated-By: Launchpad (canonical.com); Revision="16692"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: a6fc936636fd146882794c4a6d936930516fd12f X-Gm-Message-State: ALoCoQnxbD4UxE2ES5oxlrPqoHvis2J4wIb6I2B6VpgjsnTvLK/P/6iU4EKaBS6McZIiUStfgWkY X-Original-Sender: noreply@launchpad.net X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Merge authors: Stevan Radaković (stevanr) Related merge proposals: https://code.launchpad.net/~stevanr/lava-dashboard/fix-1196477/+merge/172357 proposed by: Stevan Radaković (stevanr) review: Approve - Tyler Baker (tyler-baker) ------------------------------------------------------------ revno: 410 [merge] committer: Stevan Radakovic branch nick: trunk timestamp: Tue 2013-07-02 11:30:04 +0200 message: Introduce new plot-by-measurements on Image Reports page. Reviewed by tyler-baker. modified: dashboard_app/static/dashboard_app/js/image-report.js dashboard_app/templates/dashboard_app/image-report.html dashboard_app/views/images.py --- lp:lava-dashboard https://code.launchpad.net/~linaro-validation/lava-dashboard/trunk You are subscribed to branch lp:lava-dashboard. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-dashboard/trunk/+edit-subscription === modified file 'dashboard_app/static/dashboard_app/js/image-report.js' --- dashboard_app/static/dashboard_app/js/image-report.js 2013-06-19 08:20:44 +0000 +++ dashboard_app/static/dashboard_app/js/image-report.js 2013-07-01 15:49:15 +0000 @@ -236,8 +236,10 @@ if ($.jStorage.get(prefix + "_graph_type")) { if ($.jStorage.get(prefix + "_graph_type") == "number") { $('input:radio[name=graph_type][value="number"]').attr("checked", true); - } else { + } else if ($.jStorage.get(prefix + "_graph_type") == "percentage") { $('input:radio[name=graph_type][value="percentage"]').attr("checked", true); + } else { // measurements + $('input:radio[name=graph_type][value="measurements"]').attr("checked", true); } } } @@ -261,8 +263,10 @@ if (parameters[iter][0] == "graph_type" && parameters[iter][1] != "") { if (parameters[iter][1] == "number") { $('input:radio[name=graph_type][value="number"]').attr("checked", true); - } else { + } else if (parameters[iter][1] == "percentage") { $('input:radio[name=graph_type][value="percentage"]').attr("checked", true); + } else { // measurements + $('input:radio[name=graph_type][value="measurements"]').attr("checked", true); } } } @@ -280,6 +284,7 @@ // Get the plot data. data = []; + units = ""; for (test in table_data) { if ($("#test_select").val().indexOf(test) >= 0) { @@ -292,12 +297,17 @@ if (row[iter]["cls"]) { if ($('input:radio[name=graph_type]:checked').val() == "number") { row_data.push([iter, row[iter]["passes"]]); - } else { + } else if ($('input:radio[name=graph_type]:checked').val() == "percentage") { if (isNaN(row[iter]["passes"]/row[iter]["total"])) { row_data.push([iter, 0]); } else { row_data.push([iter, 100*row[iter]["passes"]/row[iter]["total"]]); } + } else { // measurements + if (row[iter]["measurements"] && row[iter]["measurements"].length != 0) { + row_data.push([iter, row[iter]["measurements"][0]["measurement"]]); + units = row[iter]["measurements"][0]["units"]; + } } } } @@ -366,6 +376,14 @@ options["yaxis"]["min"] = 0; } + if (units != "") { + options["legend"]["labelFormatter"] = function(label, series) { + if (label.length > 20) { + return label.substring(0,20) + "..."; + } + return label + " (" + units + ")"; + } + } $.plot($("#outer-container #inner-container"), data, options); } === modified file 'dashboard_app/templates/dashboard_app/image-report.html' --- dashboard_app/templates/dashboard_app/image-report.html 2013-06-18 13:12:18 +0000 +++ dashboard_app/templates/dashboard_app/image-report.html 2013-07-01 15:49:15 +0000 @@ -76,6 +76,9 @@ By pass/fail test numbers + + By measurements + === modified file 'dashboard_app/views/images.py' --- dashboard_app/views/images.py 2013-05-30 07:45:34 +0000 +++ dashboard_app/views/images.py 2013-07-01 15:49:15 +0000 @@ -73,7 +73,7 @@ image = Image.objects.get(name=name) filter_data = image.filter.as_data() - matches = evaluate_filter(request.user, filter_data, prefetch_related=['launchpad_bugs'])[:50] + matches = evaluate_filter(request.user, filter_data, prefetch_related=['launchpad_bugs', 'test_results'])[:50] build_number_to_cols = {} @@ -88,6 +88,13 @@ else: cls = 'present fail' bug_ids = sorted([b.bug_id for b in test_run.launchpad_bugs.all()]) + + measurements = [{'item': str(item.test_case), + 'measurement': str(item.measurement), + 'units': str(item.units) + } + for item in test_run.test_results.all()] + test_run_data = dict( present=True, cls=cls, @@ -96,6 +103,7 @@ total=denorm.count_pass + denorm.count_fail, link=test_run.get_permalink(), bug_ids=bug_ids, + measurements=measurements, ) if (match.tag, test_run.bundle.uploaded_on) not in build_number_to_cols: build_number_to_cols[(match.tag, test_run.bundle.uploaded_on)] = {