speed_gun 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/browser.js +16 -2
- data/lib/speed_gun/app/public/browser.js +16 -2
- data/lib/speed_gun/profiler/manual.rb +1 -1
- data/lib/speed_gun/profiler.rb +5 -1
- data/lib/speed_gun/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5cf528977aacdbf3ccd15ec92ab77584c15a907d
|
4
|
+
data.tar.gz: d46b1fcb2f3a1347479846fb9e958723d147733e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b27e2f2d0f288178c9c026eaf4ed47ddd9779e5d60d2c88aae99ca831839d8daa0d2c9d06bac204a7b2c1b6270d9336997d7ed9966c33ab6c6bdd17c35d936f
|
7
|
+
data.tar.gz: f9114c2faffeeb1d1831e08b05fef6408136389593f1608d8e5531be694737a8e10106b6e9acc3744f0002aeed87b59f40377bc2d4bc72e67bc3049168b61889
|
@@ -50,16 +50,30 @@ if(!window['speedGun']) { window.speedGun = {}; };
|
|
50
50
|
};
|
51
51
|
|
52
52
|
speedGun.send = function(data) {
|
53
|
-
|
53
|
+
if(speedGun.activated) {
|
54
|
+
$.post(speedGun.endpoint, data, function() {});
|
55
|
+
} else {
|
56
|
+
if(!speedGun.queue) { speedGun.queue = [] };
|
57
|
+
speedGun.queue.push(data);
|
58
|
+
}
|
54
59
|
};
|
55
60
|
|
61
|
+
speedGun.processQueue = function() {
|
62
|
+
var queue = speedGun.queue || [];
|
63
|
+
for(var i = 0; i < queue.length; i++) {
|
64
|
+
speedGun.send(queue[i])
|
65
|
+
}
|
66
|
+
}
|
67
|
+
|
56
68
|
var loadedInterval = setInterval(function() {
|
57
69
|
if (performance.timing.loadEventEnd != 0) {
|
58
70
|
clearInterval(loadedInterval);
|
59
71
|
|
60
72
|
speedGun.id = $('#speed_gun').data('speed-gun-id');
|
61
73
|
speedGun.endpoint = $('#speed_gun').data('speed-gun-endpoint') + "/" + speedGun.id;
|
62
|
-
speedGun.
|
74
|
+
speedGun.activated = true;
|
75
|
+
speedGun.sendBrowserInfo();
|
76
|
+
speedGun.processQueue();
|
63
77
|
}
|
64
78
|
}, 100);
|
65
79
|
})(window['jQuery'] || window['Zepto']);
|
@@ -50,16 +50,30 @@ if(!window['speedGun']) { window.speedGun = {}; };
|
|
50
50
|
};
|
51
51
|
|
52
52
|
speedGun.send = function(data) {
|
53
|
-
|
53
|
+
if(speedGun.activated) {
|
54
|
+
$.post(speedGun.endpoint, data, function() {});
|
55
|
+
} else {
|
56
|
+
if(!speedGun.queue) { speedGun.queue = [] };
|
57
|
+
speedGun.queue.push(data);
|
58
|
+
}
|
54
59
|
};
|
55
60
|
|
61
|
+
speedGun.processQueue = function() {
|
62
|
+
var queue = speedGun.queue || [];
|
63
|
+
for(var i = 0; i < queue.length; i++) {
|
64
|
+
speedGun.send(queue[i])
|
65
|
+
}
|
66
|
+
}
|
67
|
+
|
56
68
|
var loadedInterval = setInterval(function() {
|
57
69
|
if (performance.timing.loadEventEnd != 0) {
|
58
70
|
clearInterval(loadedInterval);
|
59
71
|
|
60
72
|
speedGun.id = $('#speed_gun').data('speed-gun-id');
|
61
73
|
speedGun.endpoint = $('#speed_gun').data('speed-gun-endpoint') + "/" + speedGun.id;
|
62
|
-
speedGun.
|
74
|
+
speedGun.activated = true;
|
75
|
+
speedGun.sendBrowserInfo();
|
76
|
+
speedGun.processQueue();
|
63
77
|
}
|
64
78
|
}, 100);
|
65
79
|
})(window['jQuery'] || window['Zepto']);
|
data/lib/speed_gun/profiler.rb
CHANGED
@@ -14,7 +14,11 @@ class SpeedGun::Profiler
|
|
14
14
|
|
15
15
|
return nil unless src
|
16
16
|
|
17
|
-
|
17
|
+
restore(src)
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.restore(src)
|
21
|
+
data = src.kind_of?(String) ? MessagePack.unpack(src) : src
|
18
22
|
|
19
23
|
profiler = new({})
|
20
24
|
profiler.restore_by_hash(data)
|
data/lib/speed_gun/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: speed_gun
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sho Kusano
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|