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 +4 -4
- data/Gemfile.lock +4 -4
- data/lib/vault-tools/log.rb +2 -2
- data/lib/vault-tools/version.rb +1 -1
- data/lib/vault-tools/web.rb +1 -1
- data/test/log_test.rb +5 -4
- data/test/web_test.rb +1 -0
- 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: 42702093fbdf7f071440c64c84d4e19fcad89b6cd59a24040d4e19390104f8de
|
4
|
+
data.tar.gz: 1acc21cdd6e7b2269f628df0a544fa034a231ecf3e18a732bceaeaf292a3020a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf9329b888bccc434da560389b8beed4a37761bed3d3ebd97e47a770b9d1a6525761f8cc926bc85808af95643b72356387ecea0338cdfa056aa99a3435a4d2d3
|
7
|
+
data.tar.gz: a2b4e63e916c2827d1ad65e610280826f5955296c496e115f9ddf126af1edf6f94ff8ba87d324fb377ad9a9288016e560e198b2ce78995e7b3075e2f17d7805c
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
vault-tools (2.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.
|
21
|
-
aws-sdk-core (3.
|
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.
|
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)
|
data/lib/vault-tools/log.rb
CHANGED
@@ -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
|
data/lib/vault-tools/version.rb
CHANGED
data/lib/vault-tools/web.rb
CHANGED
@@ -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
|
|
data/test/log_test.rb
CHANGED
@@ -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
|
36
|
-
assert_equal
|
37
|
-
assert_equal '
|
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
|
data/test/web_test.rb
CHANGED
@@ -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.
|
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-
|
13
|
+
date: 2019-07-02 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: scrolls
|