consul-templaterb 1.14.0 → 1.14.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +6 -0
- data/TemplateAPI.md +1 -1
- data/lib/consul/async/stats.rb +3 -1
- data/lib/consul/async/version.rb +1 -1
- data/samples/keys.html.erb +3 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 19a9fb526bba0cc83b770850eeedca78809be239be8c59389c0bdfc9ddcaa101
|
4
|
+
data.tar.gz: a74807d9c5fff6f2dbf00379fa3cabe737f872d75a40503e05b7e9d8b2a94997
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72254dd5e093eb975fab39945b3ba0486473bcca668c955adc7aac56aa421b5b1827c78a50a1173e9949ebfb075235fef83a4ebcf14fccbc24c36aacc8c9019e
|
7
|
+
data.tar.gz: 44d8d212a1fad75022916f5cf64568415ef3f1f1b37baa89f1a4e9680379c34e9eea587f281634032b9df9a4a4254fe1e0210665b591e165e118f7c2c26f0b6d
|
data/CHANGELOG.md
CHANGED
data/TemplateAPI.md
CHANGED
@@ -30,7 +30,7 @@ On each object, you can access the `.endpoint` object that includes several info
|
|
30
30
|
|
31
31
|
* `myresult.endpoint.x_consul_index` return the current index on blocking query
|
32
32
|
* `myresult.endpoint.stats` a object with interresting fields: `bytes_per_sec`,
|
33
|
-
`bytes_per_sec_human`, `successes`, `errors`, `body_bytes`. All stats details
|
33
|
+
`bytes_per_sec_human`, `successes`, `errors`, `body_bytes`, `last_modified`. All stats details
|
34
34
|
are available in the file [lib/consul/async/stats.rb](lib/consul/async/stats.rb).
|
35
35
|
|
36
36
|
Using those statistics might be useful to trigger alerts very easily when something
|
data/lib/consul/async/stats.rb
CHANGED
@@ -3,7 +3,7 @@ require 'consul/async/utilities'
|
|
3
3
|
module Consul
|
4
4
|
module Async
|
5
5
|
class EndPointStats
|
6
|
-
attr_reader :successes, :errors, :start, :body_bytes, :last_error, :last_success, :changes, :network_bytes
|
6
|
+
attr_reader :successes, :errors, :start, :body_bytes, :last_error, :last_success, :last_modified, :changes, :network_bytes
|
7
7
|
|
8
8
|
def initialize
|
9
9
|
@start = Time.now.utc
|
@@ -14,6 +14,7 @@ module Consul
|
|
14
14
|
@network_bytes = 0
|
15
15
|
@last_error = @start
|
16
16
|
@last_success = @start
|
17
|
+
@last_modified = @start
|
17
18
|
end
|
18
19
|
|
19
20
|
def on_response(res)
|
@@ -21,6 +22,7 @@ module Consul
|
|
21
22
|
@successes += 1
|
22
23
|
@body_bytes += res.http.response.bytesize
|
23
24
|
@changes += 1 if res.modified?
|
25
|
+
@last_modified = @last_success if res.modified?
|
24
26
|
@network_bytes += res.http.response_header['Content-Length'].to_i
|
25
27
|
end
|
26
28
|
|
data/lib/consul/async/version.rb
CHANGED
data/samples/keys.html.erb
CHANGED
@@ -8,7 +8,9 @@
|
|
8
8
|
<div>
|
9
9
|
<h1>Show all keys <%= path == '' ? '' : "under hierarchy #{path}" %></h1>
|
10
10
|
<div id="accordion">
|
11
|
-
|
11
|
+
<!-- LastModified: <%= kv(path, recurse:true).endpoint.stats.last_modified %> -->
|
12
|
+
<%
|
13
|
+
kv(path, recurse:true).each do |tuple|
|
12
14
|
key = tuple['Key']
|
13
15
|
val = "NO_VALUE"
|
14
16
|
if !tuple['Value'].nil?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: consul-templaterb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.14.
|
4
|
+
version: 1.14.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SRE Core Services
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: em-http-request
|
@@ -242,8 +242,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
242
242
|
- !ruby/object:Gem::Version
|
243
243
|
version: '0'
|
244
244
|
requirements: []
|
245
|
-
|
246
|
-
rubygems_version: 2.6.14.4
|
245
|
+
rubygems_version: 3.0.3
|
247
246
|
signing_key:
|
248
247
|
specification_version: 4
|
249
248
|
summary: Implementation of Consul template using Ruby and .erb templating language
|