expeditor 0.7.0 → 0.7.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
- SHA1:
3
- metadata.gz: '0295f51ed41290a443f84e29704254cb92773e54'
4
- data.tar.gz: d4525b17a023e7aed723ed8b5d40cc7842d14d6a
2
+ SHA256:
3
+ metadata.gz: a260bbe17a9db35fafb969bd979d87cfc74c7f9b23932567b7f6dd3f378c2a98
4
+ data.tar.gz: 044615f3a206c7948f60e6fbaeb9f9c055ac1320e016c165123ddf58ec4ff5fc
5
5
  SHA512:
6
- metadata.gz: 5c07b956a48818d56ae0edfc9f282c21ffa7e90ba3432b91d3abba8a095456281cdc6ce22a8a887e72c096b94525a12fa9ddf72929761644df05492f70d02ea7
7
- data.tar.gz: 047f91f6875c87e815796801f5a67e49b4d1bcb1821a7c36c8e4835ae6c1cd0a0cfc7992d69a079b1afeb6ec9ad8e6ddf4dcbbfb1b06bbfe97476bc42dcafcf3
6
+ metadata.gz: 76dbc470fe709056315dda8d7cdbf63bd8b0ada4a62f735cbb9a7ff87c70b80aff42cd6775036a0b82a23652730d06bb878335444ce69db31f6544dd5516f109
7
+ data.tar.gz: 39e8389e033b6a2e7d2c4af73105380e878d6426002d8644253e63a3c2315de1d9730b69f9d17c306aa2d31b883e585b0968ba151b52e46ec3c12421ddffbc29
data/.travis.yml CHANGED
@@ -1,11 +1,12 @@
1
1
  language: ruby
2
- sudo: false
3
2
  cache: bundler
4
3
  rvm:
5
4
  - 2.1.10
6
- - 2.2.6
7
- - 2.3.3
8
- - 2.4.0
5
+ - 2.2.10
6
+ - 2.3.8
7
+ - 2.4.6
8
+ - 2.5.5
9
+ - 2.6.2
9
10
  - ruby-head
10
11
  matrix:
11
12
  allow_failures:
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.7.1
2
+ - Fix Ruby 2 style keyword arguments to support Ruby 3 [#45](https://github.com/cookpad/expeditor/pull/27)
3
+
1
4
  ## 0.7.0
2
5
  - Add `gem 'concurrent-ruby-ext'` to your Gemfile if you want to use that gem.
3
6
  - We should not depend on this in a gemspec [#27](https://github.com/cookpad/expeditor/pull/27)
data/README.md CHANGED
@@ -137,18 +137,14 @@ The circuit breaker needs a service metrics (success, failure, timeout, ...) to
137
137
  Expeditor's circuit breaker has a few configuration for how it collects service metrics and how it opens the circuit.
138
138
 
139
139
  For service metrics, Expeditor collects them with the given time window.
140
- The metrics is guradually collected by breaking given time window into some peice of short time windows and resetting previous metrics when passing each short time window.
141
-
142
- `non_break_count` is used to ignore requests to the service which is not frequentlly requested. Configure this value considering your estimated "requests per period to the service".
143
- For example, when `period = 10` and `non_break_count = 20` and the requests do not occur more than 20 per 10 seconds, the circuit never opens because Expeditor ignores that "small number of requests".
144
- If you don't ignore the failures in that case, set `non_break_count` to smaller value than `20`.
140
+ The metrics is gradually collected by breaking given time window into some peice of short time windows and resetting previous metrics when passing each short time window.
145
141
 
146
142
  ```ruby
147
143
  service = Expeditor::Service.new(
148
- threshold: 0.5, # If the failure rate is more than or equal to threshold, the circuit will be opened.
149
- sleep: 1, # If once the circuit is opened, the circuit is still open until sleep time seconds is passed even though failure rate is less than threshold.
150
- non_break_count: 20 # If the total count of metrics is not more than non_break_count, the circuit is not opened even though failure rate is more than threshold.
151
- period: 10, # Time window of collecting metrics (in seconds).
144
+ threshold: 0.5, # If the failure rate is more than or equal to threshold, the circuit will be opened.
145
+ sleep: 1, # If once the circuit is opened, the circuit is still open until sleep time seconds is passed even though failure rate is less than threshold.
146
+ non_break_count: 20, # If the total count of metrics is not more than non_break_count, the circuit is not opened even though failure rate is more than threshold.
147
+ period: 10, # Time window of collecting metrics (in seconds).
152
148
  )
153
149
 
154
150
  command = Expeditor::Command.new(service: service) do
@@ -156,6 +152,17 @@ command = Expeditor::Command.new(service: service) do
156
152
  end
157
153
  ```
158
154
 
155
+ `non_break_count` is used to ignore requests to the service which is not frequentlly requested. Configure this value considering your estimated "requests per period to the service".
156
+ For example, when `period = 10` and `non_break_count = 20` and the requests do not occur more than 20 per 10 seconds, the circuit never opens because Expeditor ignores that "small number of requests".
157
+ If you don't ignore the failures in that case, set `non_break_count` to smaller value than `20`.
158
+
159
+ The default values are:
160
+
161
+ - threshold: 0.5
162
+ - sleep: 1
163
+ - non_break_count: 20
164
+ - period: 10
165
+
159
166
  ### synchronous execution
160
167
 
161
168
  Use `current_thread` option of `#start`, command executes synchronous on current thread.
@@ -108,7 +108,7 @@ module Expeditor
108
108
 
109
109
  def reset_status!
110
110
  @mutex.synchronize do
111
- @rolling_number = Expeditor::RollingNumber.new(@rolling_number_opts)
111
+ @rolling_number = Expeditor::RollingNumber.new(**@rolling_number_opts)
112
112
  @breaking = false
113
113
  @break_start = nil
114
114
  end
@@ -1,3 +1,3 @@
1
1
  module Expeditor
2
- VERSION = "0.7.0"
2
+ VERSION = "0.7.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: expeditor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - shohei-yasutake
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-08 00:00:00.000000000 Z
11
+ date: 2022-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -144,7 +144,7 @@ homepage: https://github.com/cookpad/expeditor
144
144
  licenses:
145
145
  - MIT
146
146
  metadata: {}
147
- post_install_message:
147
+ post_install_message:
148
148
  rdoc_options: []
149
149
  require_paths:
150
150
  - lib
@@ -159,9 +159,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
159
159
  - !ruby/object:Gem::Version
160
160
  version: '0'
161
161
  requirements: []
162
- rubyforge_project:
163
- rubygems_version: 2.6.11
164
- signing_key:
162
+ rubygems_version: 3.3.8
163
+ signing_key:
165
164
  specification_version: 4
166
165
  summary: Expeditor provides asynchronous execution and fault tolerance for microservices
167
166
  test_files: []