From patchwork Fri Aug 19 04:16:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zygmunt Krynicki X-Patchwork-Id: 3528 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 0D36023F46 for ; Fri, 19 Aug 2011 04:16:16 +0000 (UTC) Received: from mail-ey0-f170.google.com (mail-ey0-f170.google.com [209.85.215.170]) by fiordland.canonical.com (Postfix) with ESMTP id F3D16A183CE for ; Fri, 19 Aug 2011 04:16:15 +0000 (UTC) Received: by mail-ey0-f170.google.com with SMTP id 10so2100639eyd.29 for ; Thu, 18 Aug 2011 21:16:15 -0700 (PDT) Received: by 10.213.29.147 with SMTP id q19mr17975ebc.132.1313727375775; Thu, 18 Aug 2011 21:16:15 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.213.102.5 with SMTP id e5cs112771ebo; Thu, 18 Aug 2011 21:16:15 -0700 (PDT) Received: by 10.216.134.158 with SMTP id s30mr1256504wei.71.1313727374205; Thu, 18 Aug 2011 21:16:14 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com [91.189.90.7]) by mx.google.com with ESMTPS id x69si7369376weq.33.2011.08.18.21.16.14 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 18 Aug 2011 21:16:14 -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; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1QuGVB-0008Np-P6 for ; Fri, 19 Aug 2011 04:16:13 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id B5AF8E03D1 for ; Fri, 19 Aug 2011 04:16: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: 257 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dashboard/trunk] Rev 257: Speed up image status detail page Message-Id: <20110819041613.15284.82031.launchpad@ackee.canonical.com> Date: Fri, 19 Aug 2011 04:16:13 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="13697"; Instance="initZopeless config overlay" X-Launchpad-Hash: 8c5dfd50ba32ba4d42e3ad5cca51325de042ab84 ------------------------------------------------------------ revno: 257 committer: Zygmunt Krynicki branch nick: pristine timestamp: Fri 2011-08-19 06:06:47 +0200 message: Speed up image status detail page modified: dashboard_app/models.py dashboard_app/templates/dashboard_app/image_status_detail.html --- 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/models.py' --- dashboard_app/models.py 2011-08-19 02:19:06 +0000 +++ dashboard_app/models.py 2011-08-19 04:06:47 +0000 @@ -1250,8 +1250,9 @@ ).order_by('-analyzer_assigned_date') def get_chart_data(self): - return TestResult.objects.filter( - test_run__in=self.get_recent_test_runs().order_by(), + return TestResult.objects.select_related( + ).filter( + test_run__in=[run.pk for run in self.get_recent_test_runs().only('id').order_by()] ).values( 'test_run__analyzer_assigned_date' ).extra( @@ -1263,14 +1264,18 @@ ).order_by('result') def get_test_runs(self): - return TestRun.objects.filter( + return TestRun.objects.select_related( + ).filter( bundle__bundle_stream__pathname="/anonymous/lava-daily/" ).filter( - attributes__name='rootfs.type', + attributes__name='rootfs.type' + ).filter( attributes__value=self.rootfs_type ).filter( - attributes__name='hwpack.type', - attributes__value=self.hwpack_type) + attributes__name='hwpack.type' + ).filter( + attributes__value=self.hwpack_type + ) def get_current_test_run(self, test): return self.get_all_test_runs_for_test(test).order_by('-analyzer_assigned_date')[0] === modified file 'dashboard_app/templates/dashboard_app/image_status_detail.html' --- dashboard_app/templates/dashboard_app/image_status_detail.html 2011-08-19 02:19:06 +0000 +++ dashboard_app/templates/dashboard_app/image_status_detail.html 2011-08-19 04:06:47 +0000 @@ -17,7 +17,7 @@ {% with image_health.get_recent_test_runs as recent_test_run_list %} {% if recent_test_run_list %}
-
+
- - - - - - - - {% regroup recent_test_run_list by analyzer_assigned_date|date:"Y W" as test_run_cluster_list %} + +
- History of testing {{ image_health.rootfs_type }}+{{ image_health.hwpack_type }} on a weekly basis. -
DateTestResults
+ {% regroup recent_test_run_list by analyzer_assigned_date|date:"Y-m-d" as test_run_cluster_list %} {% for test_run_cluster in test_run_cluster_list %} - + {% for test_run in test_run_cluster.list %} - - - + {% with test_run.test_results.all.order_by as all_results %} + +
{{ test_run_cluster.grouper }}Tests ran on {{ test_run_cluster.grouper }}
{{ test_run.analyzer_assigned_date|date:"m.d" }}{{ test_run.test }}{{ test_run.test_results.count }}{{ test_run.test }}{{ all_results.count }} - {% with test_run.get_summary_results as summary %} - {% with 500 as max_width %} - {% if summary.total_multiplied > max_width %} - {% if summary.pass %} -
- {% endif %} - {% if summary.fail %} -
- {% endif %} - {% if summary.skip %} -
- {% endif %} - {% if summary.unknown %} -
- {% endif %} -
{% trans "graph not to scale" %}
+ {% spaceless %} + {% regroup all_results|dictsort:"result" by result as result_group_list %} + {% for result_group in result_group_list %} + {% if result_group.list|length > 300 %} +
+
...
+
{% else %} - {% if summary.pass %} -
- {% endif %} - {% if summary.fail %} -
- {% endif %} - {% if summary.skip %} -
- {% endif %} - {% if summary.unknown %} -
- {% endif %} +
{% endif %} - {% endwith %} + {% endfor %} + {% endspaceless %} {% endwith %}