Merge lp://qastaging/~mpontillo/maas/js-metrics-service into lp://qastaging/~maas-committers/maas/trunk

Proposed by Mike Pontillo
Status: Rejected
Rejected by: MAAS Lander
Proposed branch: lp://qastaging/~mpontillo/maas/js-metrics-service
Merge into: lp://qastaging/~maas-committers/maas/trunk
Diff against target: 200 lines (+169/-0)
4 files modified
src/maasserver/static/js/angular/maas.js (+6/-0)
src/maasserver/static/js/angular/services/metrics.js (+94/-0)
src/maasserver/static/js/angular/services/tests/test_metrics.js (+68/-0)
src/maasserver/views/combo.py (+1/-0)
To merge this branch: bzr merge lp://qastaging/~mpontillo/maas/js-metrics-service
Reviewer Review Type Date Requested Status
Blake Rouse (community) Needs Fixing
Review via email: mp+322495@code.qastaging.launchpad.net

Commit message

Add JavaScript logging for $digest metrics and $routeChangeSuccess.

Description of the change

This is a branch I used earlier this cycle while debugging some UI issues, but didn't get around to proposing separately until now.

This adds logging such as the following to the JavaScript console:

Navigated to http://192.168.0.2/MAAS/
[0.616] $routeChangeSuccess: http://192.168.0.2/MAAS/#/networks?by=fabric; templateURL=static/partials/networks-list.html?v=2.2.0~rc1(bzr5922-0ubuntu2~16.04.1)
[0.787] $digest cycle 1: 18 digests completed in ~0.251 seconds.
[0.793] $digest cycle 2: 1 digest completed in ~0.001 seconds.
[1.029] $digest cycle 3: 1 digest completed in ~0.001 seconds.
[1.034] $digest cycle 4: 1 digest completed in ~0.001 seconds.
[1.105] $digest cycle 5: 1 digest completed in ~0.002 seconds.
[1.678] $digest cycle 6: 1 digest completed in ~0.001 seconds.
[1.715] $digest cycle 7: 1 digest completed in ~0.001 seconds.
[1.905] $digest cycle 8: 1 digest completed in ~0.001 seconds.
[2.095] $digest cycle 9: 2 digests completed in ~0.002 seconds.
[2.158] $digest cycle 10: 2 digests completed in ~0.002 seconds.
[2.165] $digest cycle 11: 1 digest completed in ~0.001 seconds.
[2.248] $digest cycle 12: 1 digest completed in ~0.001 seconds.
[2.258] $digest cycle 13: 1 digest completed in ~0.001 seconds.
[2.301] $digest cycle 14: 1 digest completed in ~0.001 seconds.
[2.386] Version reloader: Monitoring MAAS "maas"; version 2.2.0~rc1 (bzr5922-0ubuntu2~16.04.1) via http://192.168.0.2/MAAS/#/networks?by=fabric
[2.393] $digest cycle 15: 5 digests completed in ~0.038 seconds.
[28.874] $digest cycle 16: 3 digests completed in ~0.010 seconds.
[28.900] $routeChangeSuccess: http://192.168.0.2/MAAS/#/nodes; templateURL=static/partials/nodes-list.html?v=2.2.0~rc1(bzr5922-0ubuntu2~16.04.1)
[29.163] $digest cycle 17: 14 digests completed in ~0.091 seconds.
[29.796] $digest cycle 18: 3 digests completed in ~0.022 seconds.
[29.820] $digest cycle 19: 5 digests completed in ~0.021 seconds.
[29.873] $digest cycle 20: 2 digests completed in ~0.003 seconds.
[29.890] $digest cycle 21: 2 digests completed in ~0.004 seconds.
[29.903] $digest cycle 22: 1 digest completed in ~0.003 seconds.
[29.908] $digest cycle 23: 1 digest completed in ~0.001 seconds.
[29.970] $digest cycle 24: 2 digests completed in ~0.042 seconds.

This logging can easily be filtered using the JavaScript console if it is unwanted, since the $digest cycles are logged at debug level.

Route changes are logged at info level.

To post a comment you must log in.
Revision history for this message
Blake Rouse (blake-rouse) wrote :

This should be off in production. So you should check MAAS_config.debug, when True turn it on (dev mode), otherwise its off.

review: Needs Fixing
Revision history for this message
Mike Pontillo (mpontillo) wrote :

I thought you might say something about that.

I agree that we should have a way to turn it off by default, but I think it would be more useful if we had a way to use a cookie to set the log level for MAAS's JavaScript logging. I'll check into it.

Revision history for this message
Blake Rouse (blake-rouse) wrote :

I would recommend using a url option instead of cookies. Like ?debug=true

Revision history for this message
Mike Pontillo (mpontillo) wrote :

Good idea. I'll check into it.

Revision history for this message
MAAS Lander (maas-lander) wrote :

Transitioned to Git.

lp:maas has now moved from Bzr to Git.
Please propose your branches with Launchpad using Git.

git clone https://git.launchpad.net/maas

Unmerged revisions

5959. By Mike Pontillo

Merge trunk.

5958. By Mike Pontillo

Add metrics service.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.