kumonos 0.19.0 → 0.20.0

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
2
  SHA256:
3
- metadata.gz: 5ad34c03f753a4743846d5133b14ce0ac2d932a4ff1c2cf1a7cceb7933763ab9
4
- data.tar.gz: 1b2bf98aab7f7adbc5fcaee56a875b6c54d8bd394c68ee162d62edeaaf8438e6
3
+ metadata.gz: ad040ff88bc587db10a06df3f1e3fd9602367844128a2cdbe972947a45daed29
4
+ data.tar.gz: f9d50ca49042413de737cb82c5ea4b21c049bc413f0594967ab08d78eda2f2a9
5
5
  SHA512:
6
- metadata.gz: e1eb30a96aada1267584b1582d844df9adea466d04efca71f9c29fb85026232a53c8b98df73e7cb8352088db753f70f82adfdf2b95eb031aa9d563749f49d90c
7
- data.tar.gz: f46169d86632de1a48b24960739d659da3fc4f16d9f85b895f8539379c63524b287a2385d80da1dc20142725b00b7d535e159bc585759a04fdb2518401b13029
6
+ metadata.gz: 010a3278a0febfab40be16d8ecfb481f059053e23a96d02ec90a9b7683cb77b45df53f63abe6d91b0801d145864eec9d794cbf01df26160028deaf6a7819c473
7
+ data.tar.gz: 78b88839d966af871e0ba85072dc67e7be28ca88bafafb50022ef85278339215745cd3075e1ae31077150ff9f84a3059d7ec4d0cd245c0789c45f3c84cfa8205
data/.rubocop.yml CHANGED
@@ -17,3 +17,5 @@ Metrics/LineLength:
17
17
  Enabled: false
18
18
  Metrics/AbcSize:
19
19
  Enabled: false
20
+ Naming/UncommunicativeMethodParamName:
21
+ Enabled: false
data/.travis.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  language: ruby
2
2
  sudo: false
3
3
  rvm:
4
- - 2.4.1
4
+ - 2.5
5
5
  before_install:
6
6
  - gem update --system # https://github.com/rubygems/rubygems/pull/1819
7
7
  - gem install bundler
data/example/book.jsonnet CHANGED
@@ -21,6 +21,9 @@ local routes = import 'routes.libsonnet';
21
21
  tls: false,
22
22
  connect_timeout_ms: 250,
23
23
  circuit_breaker: circuit_breaker,
24
+ outlier_detection: {
25
+ consecutive_5xx: 3,
26
+ },
24
27
  routes: [
25
28
  routes.root,
26
29
  {
data/kumonos.gemspec CHANGED
@@ -1,4 +1,4 @@
1
- lib = File.expand_path('../lib', __FILE__)
1
+ lib = File.expand_path('lib', __dir__)
2
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
  require 'kumonos/version'
4
4
 
@@ -30,5 +30,5 @@ Gem::Specification.new do |spec|
30
30
  spec.add_development_dependency 'rake'
31
31
  spec.add_development_dependency 'rspec', '~> 3.0'
32
32
  spec.add_development_dependency 'rspec-json_matcher'
33
- spec.add_development_dependency 'rubocop', '~> 0.51.0'
33
+ spec.add_development_dependency 'rubocop'
34
34
  end
@@ -9,7 +9,7 @@ module Kumonos
9
9
  end
10
10
  end
11
11
 
12
- Cluster = Struct.new(:name, :connect_timeout_ms, :lb, :tls, :circuit_breaker, :use_sds) do
12
+ Cluster = Struct.new(:name, :connect_timeout_ms, :lb, :tls, :circuit_breaker, :outlier_detection, :use_sds) do
13
13
  class << self
14
14
  def build(h)
15
15
  use_sds = h.fetch('sds', false)
@@ -21,6 +21,7 @@ module Kumonos
21
21
  lb,
22
22
  h.fetch('tls'),
23
23
  CircuitBreaker.build(h.fetch('circuit_breaker')),
24
+ OutlierDetection.build(h['outlier_detection']), # optional
24
25
  use_sds
25
26
  )
26
27
  end
@@ -47,6 +48,12 @@ module Kumonos
47
48
  h.delete(:circuit_breaker)
48
49
  h[:circuit_breakers] = { default: circuit_breaker.to_h }
49
50
 
51
+ if outlier_detection
52
+ h[:outlier_detection] = outlier_detection.to_h
53
+ else
54
+ h.delete(:outlier_detection)
55
+ end
56
+
50
57
  h
51
58
  end
52
59
  end
@@ -58,5 +65,30 @@ module Kumonos
58
65
  end
59
66
  end
60
67
  end
68
+
69
+ OutlierDetection = Struct.new(:consecutive_5xx, :consecutive_gateway_failure, :interval_ms, :base_ejection_time_ms, :max_ejection_percent,
70
+ :enforcing_consecutive_5xx, :enforcing_consecutive_gateway_failure, :enforcing_success_rate,
71
+ :success_rate_minimum_hosts, :success_rate_request_volume, :success_rate_stdev_factor,
72
+ keyword_init: true) do
73
+ class << self
74
+ def build(h)
75
+ return nil unless h
76
+
77
+ args = {}
78
+ %w[consecutive_5xx consecutive_gateway_failure interval_ms base_ejection_time_ms max_ejection_percent
79
+ enforcing_consecutive_5xx enforcing_consecutive_gateway_failure enforcing_success_rate
80
+ success_rate_minimum_hosts success_rate_request_volume success_rate_stdev_factor].each do |e|
81
+ args[e.to_sym] = h.delete(e)
82
+ end
83
+ raise "Fields are not allowed: #{h.keys}" unless h.keys.empty?
84
+
85
+ new(**args)
86
+ end
87
+ end
88
+
89
+ def to_h
90
+ super.delete_if { |_, v| v.nil? }
91
+ end
92
+ end
61
93
  end
62
94
  end
@@ -1,3 +1,3 @@
1
1
  module Kumonos
2
- VERSION = '0.19.0'.freeze
2
+ VERSION = '0.20.0'.freeze
3
3
  end
@@ -87,6 +87,11 @@
87
87
  }
88
88
  }
89
89
  },
90
+ "outlier_detection": {
91
+ "type": "object",
92
+ "id": "/properties/dependencies/items/properties/outlier_detection",
93
+ "additionalProperties": true
94
+ },
90
95
  "routes": {
91
96
  "type": "array",
92
97
  "id": "/properties/dependencies/items/properties/routes",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kumonos
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.0
4
+ version: 0.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taiki Ono
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-04-13 00:00:00.000000000 Z
11
+ date: 2018-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json-schema
@@ -154,16 +154,16 @@ dependencies:
154
154
  name: rubocop
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - "~>"
157
+ - - ">="
158
158
  - !ruby/object:Gem::Version
159
- version: 0.51.0
159
+ version: '0'
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - "~>"
164
+ - - ">="
165
165
  - !ruby/object:Gem::Version
166
- version: 0.51.0
166
+ version: '0'
167
167
  description: A "control plane" for Microservices "service mesh".
168
168
  email:
169
169
  - taiks.4559@gmail.com