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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a0dcf0f96b5856efd0d7cdae4a792060be57aa7a007d0ea82367be71aa10d52c
4
- data.tar.gz: 2bd5f98078fa3a605f9e6e155d0bcb7cd44dce8eccd08c53ed5c82cef67b06c1
3
+ metadata.gz: cd06e9083e178d70db9715b43c644c7998ced8cf5075390fe828cf30dd0d0c07
4
+ data.tar.gz: d8bff06fa80bcf5264e2c164ddd4be7e2922792c396bfb7e768a7b449fe3c3f9
5
5
  SHA512:
6
- metadata.gz: c9353849f1c564dcfeb06a4bed35630a59d857fa69f35d1e943da06f4949755420610ce6be31ba782fce1cedc30e7f3b3572de7e832ae9ed75d1e017d11817f5
7
- data.tar.gz: f322dad148a2975afc938ba4576acb1f2cfb7bd905d0255a96c972bd1ee3671882a494f87e6811350e2b443191e94b12bf43a8e1d53be349b2e07d33c7cd864f
6
+ metadata.gz: fec53f7ee1313ca8c3a78d4f853ed99f904e8d2391d85a8073da0a7848ac7d3732be19a5c7a0fcd58b1542b1c4bc59cc01eed5ef702d3efc82251ba5770da129
7
+ data.tar.gz: bc0206179ad05e3f2e2f0a93aa3da073f54908c5b94714ec08cdd201e43ab64ffe0a0c00c75800058465d11a5c309cd7af2f30d020495be91c01396ad79a3af2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- traxor (0.1.5)
4
+ traxor (0.1.6)
5
5
  activesupport
6
6
 
7
7
  GEM
@@ -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]
@@ -1,3 +1,3 @@
1
1
  module Traxor
2
- VERSION = '0.1.5'.freeze
2
+ VERSION = '0.1.6'.freeze
3
3
  end
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.5
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-20 00:00:00.000000000 Z
11
+ date: 2018-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport