rack-mini-profiler 0.9.9 → 0.9.9.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rack-mini-profiler might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +12 -0
- data/lib/html/includes.js +14 -4
- data/lib/mini_profiler/asset_version.rb +1 -1
- data/lib/mini_profiler/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81fab6117126813e24c0138727a15d8003034ed9
|
4
|
+
data.tar.gz: ced0259792654878ede143826ba3ba25da96e7ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c480714ac5ff3cc5dd221b996a25a7f21299103e983a31fa2dff950cd26c5565d9b93525ee77cfa4af6a4edb16b84c8214e9edeff20f295a312fcc4244b8aa2
|
7
|
+
data.tar.gz: 522e2c82da57475b552b24db6ca9114df1461022f5a50a0b19a383cbfe5496918fa703e98c669552172c0df78f1a5f1dce1d47592ad60ba465ba96e68e70236a
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -184,6 +184,18 @@ Rails.application.config.to_prepare do
|
|
184
184
|
end
|
185
185
|
```
|
186
186
|
|
187
|
+
### Using in SPA applications
|
188
|
+
|
189
|
+
Single page applications built using Ember, Angular or other frameworks need some special care, as routes often change without a full page load.
|
190
|
+
|
191
|
+
On route transition always call:
|
192
|
+
|
193
|
+
```
|
194
|
+
window.MiniProfiler.pageTransition();
|
195
|
+
```
|
196
|
+
|
197
|
+
This method will remove profiling information that was related to previous page and clear aggregate statistics.
|
198
|
+
|
187
199
|
### Configuration Options
|
188
200
|
|
189
201
|
You can set configuration options using the configuration accessor on `Rack::MiniProfiler`.
|
data/lib/html/includes.js
CHANGED
@@ -7,7 +7,10 @@ var MiniProfiler = (function () {
|
|
7
7
|
controls,
|
8
8
|
fetchedIds = [],
|
9
9
|
fetchingIds = [], // so we never pull down a profiler twice
|
10
|
-
ajaxStartTime
|
10
|
+
ajaxStartTime,
|
11
|
+
totalsControl,
|
12
|
+
reqs = 0,
|
13
|
+
totalTime = 0;
|
11
14
|
;
|
12
15
|
|
13
16
|
var hasLocalStorage = function (keyPrefix) {
|
@@ -149,9 +152,6 @@ var MiniProfiler = (function () {
|
|
149
152
|
return $('#profilerTemplate').tmpl(json);
|
150
153
|
};
|
151
154
|
|
152
|
-
var totalsControl;
|
153
|
-
var reqs = 0;
|
154
|
-
var totalTime = 0;
|
155
155
|
|
156
156
|
var buttonShow = function (json) {
|
157
157
|
var result = renderTemplate(json);
|
@@ -745,6 +745,16 @@ var MiniProfiler = (function () {
|
|
745
745
|
unbindDocumentEvents();
|
746
746
|
},
|
747
747
|
|
748
|
+
pageTransition: function() {
|
749
|
+
if (totalsControl) {
|
750
|
+
totalsControl.remove();
|
751
|
+
totalsControl = null;
|
752
|
+
}
|
753
|
+
reqs = 0;
|
754
|
+
totalTime = 0;
|
755
|
+
$('.profiler-results .profiler-result').remove();
|
756
|
+
},
|
757
|
+
|
748
758
|
getClientTimingByName: function (clientTiming, name) {
|
749
759
|
|
750
760
|
for (var i = 0; i < clientTiming.timings.length; i++) {
|