vitals 0.8.1 → 0.9.0

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
  SHA1:
3
- metadata.gz: ca96cc1adb1b7c17cdb2acca6f7310620c514569
4
- data.tar.gz: 010ec1d5084df975ab6725a7a283a83efeebee28
3
+ metadata.gz: 51bb7f1aa2f18bf65d499f41c765b3b5f640d940
4
+ data.tar.gz: 72db41b451eeab862f301fe12744fc61e5ccfdbc
5
5
  SHA512:
6
- metadata.gz: 0c2d1718b765b1359cb49a4325c4047fb6253ce5e2525615c5447c2561ef8321fefa886d6ad25c5f95f37254f1105f19ea36ad7231fa5fb613140849b87d34e8
7
- data.tar.gz: 5a3c71d712e5f8a639e5354c72eb1255f7f6884f39ccc6ef55f625daf7099e5124bbff493ecd0bfb514aabba8ed05778435471f6b14f8d9430aa6fec7eaf0ff3
6
+ metadata.gz: f57c05004a563d6a5f312fbdb7ca11f3c9c3e4e1cfb36c269fd6811db4a962c293e1f2dc4d138cc4b17bd4b2cf0952fd5130181b97933c0931f8ab63b7603ed7
7
+ data.tar.gz: 5bfe19a3e3e880da7e408c488bca12b8cc394e1747fb14a8e0e3fd070ec87771ad815e467fbf09fd1bfe7ce6f5659a98d26ae5655fb14c2e00395c42aa7572de
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- vitals (0.8.0)
4
+ vitals (0.9.0)
5
5
  statsd-ruby (~> 1.3.0)
6
6
 
7
7
  GEM
@@ -7,6 +7,7 @@ module Vitals::Integrations::Rack
7
7
  SINATRA_PATH_INFO = 'sinatra.route'.freeze
8
8
  GRAPE_PATH_INFO = 'api.endpoint'.freeze
9
9
  RAILS_PATH_INFO = 'action_controller.instance'.freeze
10
+ REQ_PREF = 'vitals.req_prefix'
10
11
 
11
12
  def initialize(app, options = {})
12
13
  @app = app
@@ -17,6 +18,8 @@ module Vitals::Integrations::Rack
17
18
  start = Time.now
18
19
  status, header, body = @app.call(env)
19
20
  t = Time.now - start
21
+ req_prefix = env[REQ_PREF] ? "#{env[REQ_PREF]}." : ''
22
+
20
23
  path = if env[SINATRA_PATH_INFO]
21
24
  Requests.sinatra_path(env)
22
25
  elsif env[GRAPE_PATH_INFO]
@@ -26,7 +29,7 @@ module Vitals::Integrations::Rack
26
29
  else
27
30
  Requests.rack_path(env)
28
31
  end
29
- m = "requests.#{@prefix}#{path}.#{env[REQUEST_METHOD].downcase}.#{status}"
32
+ m = "requests.#{@prefix}#{req_prefix}#{path}.#{env[REQUEST_METHOD].downcase}.#{status}"
30
33
 
31
34
  # TODO add option to customize 'requests' through options
32
35
  Vitals.timing(m, Vitals::Utils.sec_to_ms(t))
@@ -1,3 +1,3 @@
1
1
  module Vitals
2
- VERSION = "0.8.1"
2
+ VERSION = "0.9.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vitals
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dotan Nahum
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-05-03 00:00:00.000000000 Z
11
+ date: 2016-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: statsd-ruby