Merge lp:~andreserl/maas/lp1598028_2.0 into lp:maas/2.0

Proposed by Andres Rodriguez
Status: Merged
Approved by: Andres Rodriguez
Approved revision: no longer in the source branch.
Merged at revision: 5164
Proposed branch: lp:~andreserl/maas/lp1598028_2.0
Merge into: lp:maas/2.0
Diff against target: 133 lines (+14/-12)
6 files modified
docs/changelog.rst (+2/-0)
src/maasserver/static/js/angular/controllers/node_events.js (+2/-2)
src/maasserver/static/js/angular/controllers/tests/test_node_events.js (+4/-4)
src/maasserver/static/js/angular/factories/events.js (+1/-1)
src/maasserver/static/js/angular/factories/tests/test_events.js (+3/-3)
src/maasserver/static/partials/node-events.html (+2/-2)
To merge this branch: bzr merge lp:~andreserl/maas/lp1598028_2.0
Reviewer Review Type Date Requested Status
Andres Rodriguez (community) Approve
Review via email: mp+300212@code.launchpad.net

Commit message

Backport trunk rev: 5179. Ensure we only shown the events for the last day, with the ability to see more events per day, to ensure WebUI doesn't freeze due to having tons of events.

To post a comment you must log in.
Revision history for this message
Andres Rodriguez (andreserl) wrote :

self approved as has landed in trunk rev5179

review: Approve
Revision history for this message
MAAS Lander (maas-lander) wrote :
Download full text (1.3 MiB)

The attempt to merge lp:~andreserl/maas/lp1598028_2.0 into lp:maas/2.0 failed. Below is the output from the failed tests.

Hit:1 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial InRelease
Get:2 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial-updates InRelease [95.7 kB]
Hit:3 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial-backports InRelease
Get:4 http://security.ubuntu.com/ubuntu xenial-security InRelease [94.5 kB]
Get:5 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [315 kB]
Get:6 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [294 kB]
Get:7 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 Packages [4,688 B]
Fetched 804 kB in 0s (1,775 kB/s)
Reading package lists...
sudo DEBIAN_FRONTEND=noninteractive apt-get -y \
    --no-install-recommends install apache2 archdetect-deb authbind bash bind9 bind9utils build-essential bzr bzr-builddeb chromium-browser chromium-chromedriver curl daemontools debhelper dh-apport dh-systemd distro-info dnsutils firefox freeipmi-tools git gjs ipython isc-dhcp-common libjs-angularjs libjs-jquery libjs-jquery-hotkeys libjs-yui3-full libjs-yui3-min libpq-dev make nodejs-legacy npm postgresql pxelinux python3-all python3-apt python3-bson python3-convoy python3-crochet python3-cssselect python3-curtin python3-dev python3-distro-info python3-django python3-django-nose python3-django-piston3 python3-dnspython python3-docutils python3-formencode python3-hivex python3-httplib2 python3-jinja2 python3-jsonschema python3-lxml python3-netaddr python3-netifaces python3-novaclient python3-oauth python3-oauthlib python3-openssl python3-paramiko python3-petname python3-pexpect python3-psycopg2 python3-pyinotify python3-pyparsing python3-pyvmomi python3-requests python3-seamicroclient python3-setuptools python3-simplestreams python3-sphinx python3-tempita python3-twisted python3-txtftp python3-tz python3-yaml python3-zope.interface python-bson python-crochet python-django python-django-piston python-djorm-ext-pgarray python-formencode python-lxml python-netaddr python-netifaces python-pocket-lint python-psycopg2 python-simplejson python-tempita python-twisted python-yaml socat syslinux-common tgt ubuntu-cloudimage-keyring wget xvfb
Reading package lists...
Building dependency tree...
Reading state information...
apache2 is already the newest version (2.4.18-2ubuntu3).
archdetect-deb is already the newest version (1.117ubuntu2).
authbind is already the newest version (2.1.1+nmu1).
build-essential is already the newest version (12.1ubuntu2).
curl is already the newest version (7.47.0-1ubuntu2).
debhelper is already the newest version (9.20160115ubuntu3).
distro-info is already the newest version (0.14build1).
freeipmi-tools is already the newest version (1.4.11-1ubuntu1).
git is already the newest version (1:2.7.4-0ubuntu1).
isc-dhcp-common is already the newest version (4.3.3-5ubuntu12).
libjs-angularjs is already the newest version (1.2.28-1ubuntu2).
libjs-jquery is already the newest version (1.11.3+dfsg-4).
libjs-yui3-full is already the newest versi...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'docs/changelog.rst'
2--- docs/changelog.rst 2016-07-15 02:22:48 +0000
3+++ docs/changelog.rst 2016-07-15 15:39:53 +0000
4@@ -17,6 +17,8 @@
5
6 LP: #1576116 MAAS adds regions controller as DNS resolver
7
8+LP: #1598028 [2.0] Loading latest machine events can make web browser unresponsive
9+
10
11 2.0.0 (rc2)
12 ===========
13
14=== modified file 'src/maasserver/static/js/angular/controllers/node_events.js'
15--- src/maasserver/static/js/angular/controllers/node_events.js 2016-03-28 13:54:47 +0000
16+++ src/maasserver/static/js/angular/controllers/node_events.js 2016-07-15 15:39:53 +0000
17@@ -23,7 +23,7 @@
18 $scope.node = null;
19 $scope.events = [];
20 $scope.eventsLoaded = false;
21- $scope.days = 30;
22+ $scope.days = 1;
23
24 // Called once the node is loaded.
25 function nodeLoaded(node) {
26@@ -56,7 +56,7 @@
27
28 // Called to load more events.
29 $scope.loadMore = function() {
30- $scope.days += 30;
31+ $scope.days += 1;
32 eventsManager.loadMaximumDays($scope.days);
33 };
34
35
36=== modified file 'src/maasserver/static/js/angular/controllers/tests/test_node_events.js'
37--- src/maasserver/static/js/angular/controllers/tests/test_node_events.js 2016-03-28 13:54:47 +0000
38+++ src/maasserver/static/js/angular/controllers/tests/test_node_events.js 2016-07-15 15:39:53 +0000
39@@ -101,7 +101,7 @@
40 expect($scope.node).toBeNull();
41 expect($scope.events).toEqual([]);
42 expect($scope.eventsLoaded).toEqual(false);
43- expect($scope.days).toEqual(30);
44+ expect($scope.days).toEqual(1);
45 });
46
47 it("calls loadManager with MachinesManager", function() {
48@@ -235,7 +235,7 @@
49
50 describe("loadMore", function() {
51
52- it("adds 30 days to $scope.days", function() {
53+ it("adds 1 days to $scope.days", function() {
54 var defer = $q.defer();
55 var controller = makeController(defer);
56 MachinesManager._activeItem = node;
57@@ -244,7 +244,7 @@
58 $rootScope.$digest();
59 $scope.loadMore();
60
61- expect($scope.days).toBe(60);
62+ expect($scope.days).toBe(2);
63 });
64
65 it("calls loadMaximumDays with $scope.days", function() {
66@@ -258,7 +258,7 @@
67 $rootScope.$digest();
68 $scope.loadMore();
69
70- expect(manager.loadMaximumDays).toHaveBeenCalledWith(60);
71+ expect(manager.loadMaximumDays).toHaveBeenCalledWith(2);
72 });
73 });
74 });
75
76=== modified file 'src/maasserver/static/js/angular/factories/events.js'
77--- src/maasserver/static/js/angular/factories/events.js 2015-03-30 18:57:08 +0000
78+++ src/maasserver/static/js/angular/factories/events.js 2016-07-15 15:39:53 +0000
79@@ -19,7 +19,7 @@
80 this._handler = "event";
81 this._nodeId = nodeId;
82 this._factory = factory;
83- this._maxDays = 30;
84+ this._maxDays = 1;
85 }
86
87 EventsManager.prototype = new Manager();
88
89=== modified file 'src/maasserver/static/js/angular/factories/tests/test_events.js'
90--- src/maasserver/static/js/angular/factories/tests/test_events.js 2015-03-30 14:45:39 +0000
91+++ src/maasserver/static/js/angular/factories/tests/test_events.js 2016-07-15 15:39:53 +0000
92@@ -139,7 +139,7 @@
93 expect(eventManager._nodeId).toBe(nodeId);
94 expect(eventManager._handler).toBe("event");
95 expect(eventManager._factory).toBe(EventsManagerFactory);
96- expect(eventManager._maxDays).toBe(30);
97+ expect(eventManager._maxDays).toBe(1);
98 });
99
100 describe("_initBatchLoadParameters", function() {
101@@ -147,7 +147,7 @@
102 it("returns parameters with node_id and max_days", function() {
103 expect(eventManager._initBatchLoadParameters()).toEqual({
104 "node_id": nodeId,
105- "max_days": 30
106+ "max_days": 1
107 });
108 });
109 });
110@@ -198,7 +198,7 @@
111 defer.promise);
112 spyOn(eventManager, "isLoading").and.returnValue(true);
113 eventManager.loadMaximumDays(maxDays);
114- expect(eventManager._maxDays).toBe(30);
115+ expect(eventManager._maxDays).toBe(1);
116
117 defer.resolve();
118 $rootScope.$digest();
119
120=== modified file 'src/maasserver/static/partials/node-events.html'
121--- src/maasserver/static/partials/node-events.html 2016-04-11 16:23:26 +0000
122+++ src/maasserver/static/partials/node-events.html 2016-07-15 15:39:53 +0000
123@@ -11,8 +11,8 @@
124 <h1 class="page-header__title eight-col">
125 {$ node.fqdn $}
126 <span class="page-header__title--identicator">
127- {$ events.length $} machine events in the past {$ days $} days
128- <a href="" class="page-header__title-loadmore" data-ng-click="loadMore()">load 30 more days</a>
129+ {$ events.length $} machine events in the past {$ days $} day(s)
130+ <a href="" class="page-header__title-loadmore" data-ng-click="loadMore()">load 1 more day</a>
131 </span>
132 </h1>
133 <div class="page-header__actions four-col last-col">

Subscribers

People subscribed via source and target branches