Merge lp:~mpontillo/maas/session-service into lp:~maas-committers/maas/trunk
Status: | Rejected |
---|---|
Rejected by: | MAAS Lander |
Proposed branch: | lp:~mpontillo/maas/session-service |
Merge into: | lp:~maas-committers/maas/trunk |
Diff against target: |
544 lines (+462/-5) 10 files modified
src/maasserver/static/js/angular/directives/version_reloader.js (+10/-5) src/maasserver/static/js/angular/maas.js (+6/-0) src/maasserver/static/js/angular/services/log.js (+95/-0) src/maasserver/static/js/angular/services/metrics.js (+94/-0) src/maasserver/static/js/angular/services/session.js (+26/-0) src/maasserver/static/js/angular/services/tests/test_log.js (+112/-0) src/maasserver/static/js/angular/services/tests/test_metrics.js (+68/-0) src/maasserver/static/js/angular/services/tests/test_session.js (+29/-0) src/maasserver/static/js/angular/testing/setup.js (+19/-0) src/maasserver/views/combo.py (+3/-0) |
To merge this branch: | bzr merge lp:~mpontillo/maas/session-service |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
MAAS Maintainers | Pending | ||
Review via email: mp+315325@code.launchpad.net |
Commit message
Add client-side services for logging, sessions, and metrics.
* LogService
- Adds log levels and the ability to enable/disable logging.
- Adds formatted timestamps to the beginning of each log message.
* SessionService
- Provides a way to persist data inside an Angular "session" across
scopes being destroyed and recreated.
* MetricsService
- Add summary logging for when $digest cycles occur.
- Add logging for when route changes occur (such as navigation to another page).
Drive-by fix for logging in version reloader. (Fix a bug in the logging, and change it to use the LogService.)
Description of the change
The branch name is confusing; at first this was just a SessionService, but it has been refactored into three different services, for clean separation of responsibilities.
First, this branch adds a SessionService to the $rootScope, which can be used to persist data for various views (such as the current state of the "group by" box on the network listing page). It has a facility for a particular scope (such as the NetworksListCon
Next, while troubleshooting the networks listing page, I wanted to know when $digest was being called, and roughly how long it was taking. (And I was frustrated that it was difficult to get that data.) So I figured out a clean way to summarize calls to $digest without spamming the log too much, and added a MetricsService to handle that.
Having done all that, I noticed that the new cleaner logging clashed with the logging in the version reloader directive (which was somewhat buggy, in that it logged for no reason). So I cleaned that up so that it's more useful now, and made that use the SessionService for logging, to be consistent (and so that I could centralize logging configuration in the SessionService).
Lastly, I then realized that it was difficult to tell which $digest logs were relevant to which page as I navigated around. So I added logging for route updates as well.
The LogService was later refactored out as its own service, since it didn't belong in services intended for persisting session information or metrics. With that, I also added support for all the different log levels, and allow the log level to be specified.
Unmerged revisions
- 5654. By Mike Pontillo
-
Add tests for MetricsService.
- 5653. By Mike Pontillo
-
Add test for __log().
- 5652. By Mike Pontillo
-
Add test for formatMilliseconds.
- 5651. By Mike Pontillo
-
Add tests for LogSerivce.
- 5650. By Mike Pontillo
-
80 column rule.
- 5649. By Mike Pontillo
-
Minor cleanup.
- 5648. By Mike Pontillo
-
Add tests for SessionSerivce.
- 5647. By Mike Pontillo
-
SRP: Split SessionService into three different services.
- 5646. By Mike Pontillo
-
Fix unintentional change.
- 5645. By Mike Pontillo
-
Add missing file.
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