traxor 0.1.5 → 0.1.6
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 +8 -0
- data/lib/traxor/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd06e9083e178d70db9715b43c644c7998ced8cf5075390fe828cf30dd0d0c07
|
4
|
+
data.tar.gz: d8bff06fa80bcf5264e2c164ddd4be7e2922792c396bfb7e768a7b449fe3c3f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fec53f7ee1313ca8c3a78d4f853ed99f904e8d2391d85a8073da0a7848ac7d3732be19a5c7a0fcd58b1542b1c4bc59cc01eed5ef702d3efc82251ba5770da129
|
7
|
+
data.tar.gz: bc0206179ad05e3f2e2f0a93aa3da073f54908c5b94714ec08cdd201e43ab64ffe0a0c00c75800058465d11a5c309cd7af2f30d020495be91c01396ad79a3af2
|
data/Gemfile.lock
CHANGED
@@ -8,6 +8,12 @@ module Traxor
|
|
8
8
|
|
9
9
|
def call(env)
|
10
10
|
env['traxor.rack.middleware.pre_middleware_start'] = Time.now.to_f
|
11
|
+
queue_duration = nil
|
12
|
+
request_start_ms = env['HTTP_X_REQUEST_START']
|
13
|
+
if request_start_ms
|
14
|
+
request_start = Time.at(request_start_ms.to_f / 1_000)
|
15
|
+
queue_duration = request_start.to_f - env['traxor.rack.middleware.pre_middleware_start'].to_f
|
16
|
+
end
|
11
17
|
status, headers, body = @app.call(env)
|
12
18
|
env['traxor.rack.middleware.post_middleware_end'] = Time.now.to_f
|
13
19
|
|
@@ -34,6 +40,7 @@ module Traxor
|
|
34
40
|
|
35
41
|
Metric.measure 'rack.request.middleware.duration', "#{middleware_time.round(2)}ms", tags
|
36
42
|
Metric.measure "rack.request.middleware.duration.#{controller_path}", "#{middleware_time.round(2)}ms", tags
|
43
|
+
Metric.measure "rack.request.queue.duration.#{controller_path}", "#{queue_duration.round(2)}ms", tags if queue_duration
|
37
44
|
Metric.measure "rack.request.duration.#{controller_path}", "#{total_time.round(2)}ms", tags
|
38
45
|
Metric.count "rack.request.count.#{controller_path}", 1, tags
|
39
46
|
end
|
@@ -41,6 +48,7 @@ module Traxor
|
|
41
48
|
Metric.measure 'rack.request.duration', "#{total_time.round(2)}ms", tags
|
42
49
|
end
|
43
50
|
|
51
|
+
Metric.measure 'rack.request.queue.duration', "#{queue_duration.round(2)}ms", tags if queue_duration
|
44
52
|
Metric.count 'rack.request.count', 1, tags
|
45
53
|
|
46
54
|
[status, headers, body]
|
data/lib/traxor/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: traxor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Hansen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|