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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c05196b7f48dcba8969e4b13af084cb6907c08b316bd9e9a27b3fd17248a8ca7
4
- data.tar.gz: 4d1e77216c8970ef906fd49a2f5b02f7f83178ddf60d002abc2c952249d9ef73
3
+ metadata.gz: d6a5f1c3f6e8e601f0e10067aff36a1c98043ed5a1e9f67d2a29c0c93a4a00c5
4
+ data.tar.gz: e8570fa252f2b6540bdc1da0e6af33a761815f11d30a945930bf89131501078a
5
5
  SHA512:
6
- metadata.gz: 25cbb587ee6a79143a9ba8710fc7a39ab7ee96d1541b4866c5feabf47e521a7fdb2273c0f6eef85e840f455e4aa6045cc2f34a57cd9e000ec31be31c30371a46
7
- data.tar.gz: f3f96a118fd6bbc142c3b614c5fe13927f4ddc92976142d385c63590f96f1d7365d203902b2acd29618917c6e8782f5a319ad773adb90810d319b9b27b1af40d
6
+ metadata.gz: '09b00e3b1bb0f3c090a52c1b31c94ea94216dd590b1cf4a93f328a5213505f39236b18011b8df1ad4e85264059242ae9436f83fd9c8ae5022738341bb36b394c'
7
+ data.tar.gz: e03db5db0aa0c3b4e519fd365b007768af5208f6acca8ed0cafd6a537c488123039e44a208bb3f0f61f8a787a10903dd56fc914033e2f0631c66ad1eef7759e2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- traxor (0.1.2)
4
+ traxor (0.1.3)
5
5
  activesupport
6
6
 
7
7
  GEM
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Traxor
2
- VERSION = '0.1.2'.freeze
2
+ VERSION = '0.1.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: traxor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Hansen