vault-tools 2.0.0 → 2.0.1

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: 9265591e92a631fd1b996644985ee742c622ac3259412dc5b7ca2e6ff3c7aebe
4
- data.tar.gz: b01e51fe465c1a001685bd909fcbfec83757005cad808b34918328af0fca4906
3
+ metadata.gz: 42702093fbdf7f071440c64c84d4e19fcad89b6cd59a24040d4e19390104f8de
4
+ data.tar.gz: 1acc21cdd6e7b2269f628df0a544fa034a231ecf3e18a732bceaeaf292a3020a
5
5
  SHA512:
6
- metadata.gz: 3910495873e72ce2299d303118e790fa42f22ec6acd0fe440d2d1ca595a394e50afc30e58751a352db9b5ed87f6448aa88db042ab8059bee6b9b58da53376df7
7
- data.tar.gz: 4dd78be8dec844bb89a2729309ffe80f8084736c9535e0d74ecf8a352cffde2fa9f548cc303443732aa0e750ae5c0074257adeae54e28f38c72548c804dab6d8
6
+ metadata.gz: bf9329b888bccc434da560389b8beed4a37761bed3d3ebd97e47a770b9d1a6525761f8cc926bc85808af95643b72356387ecea0338cdfa056aa99a3435a4d2d3
7
+ data.tar.gz: a2b4e63e916c2827d1ad65e610280826f5955296c496e115f9ddf126af1edf6f94ff8ba87d324fb377ad9a9288016e560e198b2ce78995e7b3075e2f17d7805c
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- vault-tools (2.0.0)
4
+ vault-tools (2.0.1)
5
5
  aws-sdk-s3 (~> 1.0)
6
6
  coderay
7
7
  excon
@@ -17,8 +17,8 @@ GEM
17
17
  remote: https://rubygems.org/
18
18
  specs:
19
19
  aws-eventstream (1.0.1)
20
- aws-partitions (1.127.0)
21
- aws-sdk-core (3.44.1)
20
+ aws-partitions (1.141.0)
21
+ aws-sdk-core (3.46.2)
22
22
  aws-eventstream (~> 1.0)
23
23
  aws-partitions (~> 1.0)
24
24
  aws-sigv4 (~> 1.0)
@@ -26,7 +26,7 @@ GEM
26
26
  aws-sdk-kms (1.13.0)
27
27
  aws-sdk-core (~> 3, >= 3.39.0)
28
28
  aws-sigv4 (~> 1.0)
29
- aws-sdk-s3 (1.30.0)
29
+ aws-sdk-s3 (1.30.1)
30
30
  aws-sdk-core (~> 3, >= 3.39.0)
31
31
  aws-sdk-kms (~> 1)
32
32
  aws-sigv4 (~> 1.0)
@@ -20,8 +20,8 @@ module Vault
20
20
  # well as classes of HTTP status codes.
21
21
  #
22
22
  # @param status [Integer] The HTTP status code to record.
23
- def self.count_status(status)
24
- count("http.#{status}")
23
+ def self.count_status(status, data)
24
+ count("http.#{status}", 1, data)
25
25
  if status_prefix = status.to_s.match(/\d/)[0]
26
26
  count("http.#{status_prefix}xx")
27
27
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Vault
4
4
  module Tools
5
- VERSION = '2.0.0'
5
+ VERSION = '2.0.1'
6
6
  end
7
7
  end
@@ -105,7 +105,7 @@ module Vault
105
105
  # Log details about the request including how long it took.
106
106
  after do
107
107
  @action ||= 'unknown'
108
- Log.count_status(response.status)
108
+ Log.count_status(response.status, request_path: request.path_info)
109
109
  Log.time("http.#{@action}", (Time.now - @start_request) * 1000)
110
110
  end
111
111
 
@@ -31,10 +31,11 @@ class LogTest < Vault::TestCase
31
31
 
32
32
  # Vault::Log.count_status emits metrics to measure HTTP responses.
33
33
  def test_count_status
34
- Vault::Log.count_status(201)
35
- assert_equal '1', logged_data['count#test-app.http.201']
36
- assert_equal '1', logged_data['count#test-app.http.2xx']
37
- assert_equal 'test-deploy', logged_data['source']
34
+ Vault::Log.count_status(201, request_path: '/some/request/path')
35
+ assert_equal 1, logdata['count#test-app.http.201']
36
+ assert_equal 1, logdata['count#test-app.http.2xx']
37
+ assert_equal '/some/request/path', logdata['request_path']
38
+ assert_equal 'test-deploy', logdata['source']
38
39
  end
39
40
 
40
41
  def test_measure
@@ -155,6 +155,7 @@ class WebTest < Vault::TestCase
155
155
  head '/'
156
156
  assert_equal '1', logged_data['count#test-app.http.200']
157
157
  assert_equal '1', logged_data['count#test-app.http.2xx']
158
+ assert_equal '/', logged_data['request_path']
158
159
  assert_equal(200, last_response.status)
159
160
  end
160
161
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vault-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Continanza
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2019-01-14 00:00:00.000000000 Z
13
+ date: 2019-07-02 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: scrolls