Merge lp:~andreserl/maas/lp1598028 into lp:~maas-committers/maas/trunk

Proposed by Andres Rodriguez
Status: Merged
Approved by: Andres Rodriguez
Approved revision: no longer in the source branch.
Merged at revision: 5179
Proposed branch: lp:~andreserl/maas/lp1598028
Merge into: lp:~maas-committers/maas/trunk
Diff against target: 120 lines (+12/-12)
5 files modified
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
Reviewer Review Type Date Requested Status
Jeffrey C Jones (community) Approve
MAAS Maintainers Pending
Review via email: mp+300014@code.launchpad.net

Commit message

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.

Description of the change

Nowadays, MAAS can have hundreds of events a day. Loading 30 days worth of events might be lagging the webui. With this, we ensure we only log the day's events and add the abiilty for users to add day by day instead of loading 30 days

To post a comment you must log in.
Revision history for this message
Jeffrey C Jones (trapnine) wrote :

LGTM

review: Approve
Revision history for this message
Gavin Panella (allenap) wrote :

One thing.

Revision history for this message
Gavin Panella (allenap) :
Revision history for this message
MAAS Lander (maas-lander) wrote :
Download full text (1.3 MiB)

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

Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [94.5 kB]
Hit:2 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial InRelease
Get:3 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial-updates InRelease [95.7 kB]
Hit:4 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial-backports InRelease
Get:5 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial-updates/main Sources [162 kB]
Get:6 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial-updates/universe Sources [82.1 kB]
Get:7 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial-updates/multiverse Sources [2,552 B]
Get:8 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [313 kB]
Get:9 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial-updates/main Translation-en [117 kB]
Get:10 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [294 kB]
Get:11 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial-updates/universe Translation-en [98.5 kB]
Get:12 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 Packages [4,688 B]
Get:13 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial-updates/multiverse Translation-en [2,140 B]
Fetched 1,266 kB in 0s (2,637 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.117ubu...

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

The attempt to merge lp:~andreserl/maas/lp1598028 into lp:maas 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 Sources [163 kB]
Get:6 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial-updates/universe Sources [82.1 kB]
Get:7 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [315 kB]
Get:8 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial-updates/main Translation-en [119 kB]
Get:9 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [293 kB]
Get:10 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial-updates/universe Translation-en [98.8 kB]
Get:11 http://security.ubuntu.com/ubuntu xenial-security/main Sources [31.7 kB]
Get:12 http://security.ubuntu.com/ubuntu xenial-security/universe Sources [8,508 B]
Get:13 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [121 kB]
Get:14 http://security.ubuntu.com/ubuntu xenial-security/main Translation-en [46.6 kB]
Get:15 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [35.7 kB]
Get:16 http://security.ubuntu.com/ubuntu xenial-security/universe Translation-en [21.5 kB]
Fetched 1,526 kB in 0s (2,617 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 pack...

Preview Diff

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