traxor 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/traxor/rack/middleware/pre.rb +4 -4
- data/lib/traxor/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6a5f1c3f6e8e601f0e10067aff36a1c98043ed5a1e9f67d2a29c0c93a4a00c5
|
4
|
+
data.tar.gz: e8570fa252f2b6540bdc1da0e6af33a761815f11d30a945930bf89131501078a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '09b00e3b1bb0f3c090a52c1b31c94ea94216dd590b1cf4a93f328a5213505f39236b18011b8df1ad4e85264059242ae9436f83fd9c8ae5022738341bb36b394c'
|
7
|
+
data.tar.gz: e03db5db0aa0c3b4e519fd365b007768af5208f6acca8ed0cafd6a537c488123039e44a208bb3f0f61f8a787a10903dd56fc914033e2f0631c66ad1eef7759e2
|
data/Gemfile.lock
CHANGED
@@ -19,29 +19,29 @@ module Traxor
|
|
19
19
|
'traxor.rack.middleware.post_middleware_end'
|
20
20
|
]
|
21
21
|
|
22
|
+
tags = {}
|
23
|
+
|
22
24
|
if times.all? { |t| env[t].present? }
|
23
25
|
pre_time = (env['traxor.rack.middleware.pre_middleware_end'].to_f - env['traxor.rack.middleware.pre_middleware_start'].to_f)
|
24
26
|
post_time = (env['traxor.rack.middleware.post_middleware_end'].to_f - env['traxor.rack.middleware.post_middleware_start'].to_f)
|
25
27
|
middleware_time = (pre_time + post_time) * 1_000
|
26
28
|
total_time = (env['traxor.rack.middleware.post_middleware_end'].to_f - env['traxor.rack.middleware.pre_middleware_start'].to_f) * 1_000
|
27
29
|
|
28
|
-
tags = {}
|
29
30
|
if controller
|
30
31
|
method = env['REQUEST_METHOD'].to_s
|
31
32
|
tags = { controller: Traxor.normalize_name(controller.class), action: Traxor.normalize_name(controller.action_name), method: Traxor.normalize_name(method) }
|
32
33
|
controller_path = tags.values.join('.')
|
33
34
|
|
35
|
+
Metric.measure 'rack.request.middleware.duration', "#{middleware_time.round(2)}ms", tags
|
34
36
|
Metric.measure "rack.request.middleware.duration.#{controller_path}", "#{middleware_time.round(2)}ms", tags
|
35
37
|
Metric.measure "rack.request.duration.#{controller_path}", "#{total_time.round(2)}ms", tags
|
36
|
-
Metric.count 'rack.request.count', 1, tags
|
37
38
|
Metric.count "rack.request.count.#{controller_path}", 1, tags
|
38
39
|
end
|
39
40
|
|
40
|
-
Metric.measure 'rack.request.middleware.duration', "#{middleware_time.round(2)}ms", tags
|
41
41
|
Metric.measure 'rack.request.duration', "#{total_time.round(2)}ms", tags
|
42
42
|
end
|
43
43
|
|
44
|
-
Metric.count 'rack.request.count', 1
|
44
|
+
Metric.count 'rack.request.count', 1, tags
|
45
45
|
|
46
46
|
[status, headers, body]
|
47
47
|
end
|
data/lib/traxor/version.rb
CHANGED