consul-templaterb 1.14.0 → 1.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 4cf5c69b8bbbe9ee35642288ce1e5535e2faa3d0
4
- data.tar.gz: e40f21f3950ee6276e68022c9e1480f06098850b
2
+ SHA256:
3
+ metadata.gz: 19a9fb526bba0cc83b770850eeedca78809be239be8c59389c0bdfc9ddcaa101
4
+ data.tar.gz: a74807d9c5fff6f2dbf00379fa3cabe737f872d75a40503e05b7e9d8b2a94997
5
5
  SHA512:
6
- metadata.gz: 5e325f31bbc13002496602c82b1c58b661118443048ce43bf7cbd8520dce9afe024fdf5f6d3d43db6422521f3f80408d2cea94617d4f1ad91ca7fcd0ec3cfae8
7
- data.tar.gz: 1d81cb3a0c852f95e501a3b6aec6a8db6c3baab3406f81389ed85830772906fea3bfb1e28b9efea1dfb0b88296b5ba98a3c0c2a35d7a8133d8953e6b440bc854
6
+ metadata.gz: 72254dd5e093eb975fab39945b3ba0486473bcca668c955adc7aac56aa421b5b1827c78a50a1173e9949ebfb075235fef83a4ebcf14fccbc24c36aacc8c9019e
7
+ data.tar.gz: 44d8d212a1fad75022916f5cf64568415ef3f1f1b37baa89f1a4e9680379c34e9eea587f281634032b9df9a4a4254fe1e0210665b591e165e118f7c2c26f0b6d
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## (UNRELEASED)
4
4
 
5
+ ## 1.14.1 (May 13, 2019)
6
+
7
+ NEW FEATURES
8
+
9
+ `endpoint.stats.last_modified` allow to display the date at which the data was last_modified.
10
+
5
11
  ## 1.14.0 (May 6, 2019)
6
12
 
7
13
  NEW FEATURES:
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
@@ -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
 
@@ -1,5 +1,5 @@
1
1
  module Consul
2
2
  module Async
3
- VERSION = '1.14.0'.freeze
3
+ VERSION = '1.14.1'.freeze
4
4
  end
5
5
  end
@@ -8,7 +8,9 @@
8
8
  <div>
9
9
  <h1>Show all keys <%= path == '' ? '' : "under hierarchy #{path}" %></h1>
10
10
  <div id="accordion">
11
- <% kv(path, recurse:true).each do |tuple|
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.0
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-06 00:00:00.000000000 Z
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
- rubyforge_project:
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