consul-templaterb 1.9.0 → 1.9.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: 8efd0da9a415f6e58d2da8e712ea082efd08b51631b38c31db287cbbdf3a3bbe
4
- data.tar.gz: 9e1fdd39625a7213dfb431dc89660fdeb0da382c4459766f5a2d34803313b9fd
3
+ metadata.gz: 0baeb6d85fa2f689ac4ff09c496188c635affe3c36d4be0646bb12fd98bf788b
4
+ data.tar.gz: c9a0a12bd22972c20a88ba5cacdebb26f754e831a8c57631b4d2b3d3336512a5
5
5
  SHA512:
6
- metadata.gz: 5f7c6e9187971dda5aadab619fe58facf7c76fe6cf7dde9a5d9c3708d525e8a3fc4bd8b8b558ccfcd8a3b2fafaf923acb7f5f673e9428635ef9b391ec50f6f79
7
- data.tar.gz: 8031be2c311b9e1f12127a5e15922d13a12f86c86e2e0ec1ea92c1282c7f382fdab2f851c6bbb43b6d63dba91a8eb731df7825d93aaae7164407db1b1c48ebcf
6
+ metadata.gz: 392d5e80cc2cc910500e5d0d93f0ab5dda3e65396ca745d6881c8cf10fc3775c59d7418af83d4aebbf44cfc55036ed942b41a1ef6eff8ea16a2db65401c8c2eb
7
+ data.tar.gz: b88eaa96328377e5a7c23fa8283a4165831b57c4cb7861ca71352446711850e5f6afcc392819baee38aeb3ecafdc424fbeada84925be6c52109f9375f9f86b73
@@ -2,15 +2,25 @@
2
2
 
3
3
  ## (UNRELEASED)
4
4
 
5
+ ## 1.9.1
6
+
7
+ NEW FEATURES:
8
+
9
+ * Now display effective network bandwidth instead of uncompressed bandwidth
10
+ * for catalog/services and catalog/nodes, now min delay is 15s instead of 30s
11
+
5
12
  ## 1.9.0
6
13
 
7
14
  OPTIMIZATIONS:
15
+
8
16
  * Better network issue because of X-Consul-Index parsing bug
9
17
 
10
18
  NEW FEATURES:
19
+
11
20
  * value.endpoint.x_consul_index now works as expected
12
21
 
13
22
  IMPROVEMENTS:
23
+
14
24
  * timeline now works well behing load balancer without stickyness
15
25
  * Now hide service column when filtering on a service
16
26
  * apply row limits immediately
@@ -54,10 +54,10 @@ options = {
54
54
  enable_gzip_compression: true,
55
55
  paths: {
56
56
  '/v1/catalog/services': {
57
- min_duration: 30, # Since services change a lot, refresh services every 30 seconds
57
+ min_duration: 15, # Since services change a lot, refresh services every 15 seconds
58
58
  },
59
59
  '/v1/catalog/nodes': {
60
- min_duration: 30, # Do not wake up before 30 seconds when node appear/disappear
60
+ min_duration: 15, # Do not wake up before 15 seconds when node appear/disappear
61
61
  },
62
62
  '/v1/catalog/datacenters': {
63
63
  min_duration: 60, # Datacenters are not added every minute, right?
@@ -32,7 +32,8 @@ module Consul
32
32
  success: 0,
33
33
  errors: 0,
34
34
  bytes_read: 0,
35
- changes: 0
35
+ changes: 0,
36
+ network_bytes: 0
36
37
  }
37
38
  @context = {
38
39
  current_erb_path: nil,
@@ -224,7 +225,7 @@ module Consul
224
225
  if last_result != data
225
226
  STDERR.print "[INFO] Write #{Utilities.bytes_to_h data.bytesize} bytes to #{file}, "\
226
227
  "netinfo=#{@net_info} aka "\
227
- "#{Utilities.bytes_to_h((net_info[:bytes_read] / (Time.now.utc - @start_time)).round(1))}/s ...\n"
228
+ "#{Utilities.bytes_to_h((net_info[:network_bytes] / (Time.now.utc - @start_time)).round(1))}/s ...\n"
228
229
  tmp_file = "#{file}.tmp"
229
230
  File.open(tmp_file, 'w') do |f|
230
231
  f.write data
@@ -258,8 +259,10 @@ module Consul
258
259
  STDERR.print "[INFO] path #{path.ljust(64)} #{query_params.inspect}\r"
259
260
  @endpoints[fqdn] = tpl
260
261
  tpl.endpoint.on_response do |result|
261
- @net_info[:success] = @net_info[:success] + 1
262
- @net_info[:bytes_read] = @net_info[:bytes_read] + result.data.bytesize
262
+ @net_info[:success] += 1
263
+ @net_info[:bytes_read] += result.data.bytesize
264
+ @net_info[:changes] += 1 if result.modified?
265
+ @net_info[:network_bytes] += result.http.response_header['Content-Length'].to_i
263
266
  end
264
267
  tpl.endpoint.on_error { @net_info[:errors] = @net_info[:errors] + 1 }
265
268
  end
@@ -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
6
+ attr_reader :successes, :errors, :start, :body_bytes, :last_error, :last_success, :changes, :network_bytes
7
7
 
8
8
  def initialize
9
9
  @start = Time.now.utc
@@ -11,6 +11,7 @@ module Consul
11
11
  @errors = 0
12
12
  @body_bytes = 0
13
13
  @changes = 0
14
+ @network_bytes = 0
14
15
  @last_error = @start
15
16
  @last_success = @start
16
17
  end
@@ -18,8 +19,9 @@ module Consul
18
19
  def on_response(res)
19
20
  @last_success = Time.now.utc
20
21
  @successes += 1
21
- @body_bytes = body_bytes + res.http.response.bytesize
22
- @changes += res.modified? ? 1 : 0
22
+ @body_bytes += res.http.response.bytesize
23
+ @changes += 1 if res.modified?
24
+ @network_bytes += res.http.response_header['Content-Length'].to_i
23
25
  end
24
26
 
25
27
  def on_error(_http)
@@ -1,5 +1,5 @@
1
1
  module Consul
2
2
  module Async
3
- VERSION = '1.9.0'.freeze
3
+ VERSION = '1.9.1'.freeze
4
4
  end
5
5
  end
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.9.0
4
+ version: 1.9.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-01-02 00:00:00.000000000 Z
11
+ date: 2019-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: em-http-request