expeditor 0.7.0 → 0.7.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 +5 -5
- data/.travis.yml +5 -4
- data/CHANGELOG.md +3 -0
- data/README.md +16 -9
- data/lib/expeditor/service.rb +1 -1
- data/lib/expeditor/version.rb +1 -1
- metadata +6 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a260bbe17a9db35fafb969bd979d87cfc74c7f9b23932567b7f6dd3f378c2a98
|
4
|
+
data.tar.gz: 044615f3a206c7948f60e6fbaeb9f9c055ac1320e016c165123ddf58ec4ff5fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76dbc470fe709056315dda8d7cdbf63bd8b0ada4a62f735cbb9a7ff87c70b80aff42cd6775036a0b82a23652730d06bb878335444ce69db31f6544dd5516f109
|
7
|
+
data.tar.gz: 39e8389e033b6a2e7d2c4af73105380e878d6426002d8644253e63a3c2315de1d9730b69f9d17c306aa2d31b883e585b0968ba151b52e46ec3c12421ddffbc29
|
data/.travis.yml
CHANGED
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
|
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,
|
149
|
-
sleep: 1,
|
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,
|
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.
|
data/lib/expeditor/service.rb
CHANGED
@@ -108,7 +108,7 @@ module Expeditor
|
|
108
108
|
|
109
109
|
def reset_status!
|
110
110
|
@mutex.synchronize do
|
111
|
-
@rolling_number = Expeditor::RollingNumber.new(
|
111
|
+
@rolling_number = Expeditor::RollingNumber.new(**@rolling_number_opts)
|
112
112
|
@breaking = false
|
113
113
|
@break_start = nil
|
114
114
|
end
|
data/lib/expeditor/version.rb
CHANGED
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.
|
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:
|
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
|
-
|
163
|
-
|
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: []
|