cdfive
8661d9abc1
Add support for logging into console for common logs ( #836 )
* Add a ConsoleHandler to support logging into stdout and stderr.
* Add a `csp.sentinel.log.output.type` property to configure for output type of record logs (only a temporary design)
* Add millisecond to the format of CspFormatter
5 years ago
Eric Zhao
00f116e344
Refine the DegradeRule and add validating logic for the two new attributes
- improvement of #789
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
5 years ago
Lin.Liang
2eecd3ac6a
Make the value of RT_MAX_EXCEED_N in DegradeRule configurable ( #789 )
- Add two attributes in DegradeRule: rtSlowRequestAmount and minRequestAmount
5 years ago
Lin.Liang
e6e27c6faa
Make maxParamByteSize configurable in ParamFlowRequestDataWriter of cluster client module and fix bugs ( #823 )
5 years ago
kexianjun
0176f0ead3
Use calculateTimeIdx to calculate array idx in LeapArray#getPreviousWindow ( #723 )
* also some code cleanup
5 years ago
Lin.Liang
ee38587a6e
Remove redundant operation when adding child node in NodeSelectorSlot ( #794 )
5 years ago
Lin.Liang
3a9e2629b7
Replace AtomicInteger with LongAdder for curThreadNum of StatisticNode ( #747 )
5 years ago
Eric Zhao
f8ebbbccf4
Bump version to 1.7.0-SNAPSHOT
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
5 years ago
Eric Zhao
3d2c33ef1d
Bump version to 1.6.1 (release)
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
5 years ago
Carpenter Lee
f3e705c5f3
Add exceptionsToTrace and exceptionsToIgnore support in Tracer ( #766 )
Signed-off-by: Carpenter Lee <hooleeucas@163.com>
5 years ago
Eric Zhao
54da16d304
Refactor FlowRuleChecker to improve code reuse
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
5 years ago
yikangfeng
4ec0462e31
Add getCpuUsageThreshold() method in SystemRuleManager ( #770 )
5 years ago
Carpenter Lee
18d8b4c8a7
Add CPU usage and system load to metric ( #749 )
Signed-off-by: Carpenter Lee <hooleeucas@163.com>
5 years ago
Eric Zhao
6e4560845c
Update SENTINEL_VERSION constant to 1.6.1
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
5 years ago
Carpenter Lee
a2683383d1
[Feature]Add an extension to Sentinel internal statistics ( #730 )
Add Sentinel MetricExtension, which provides extension to Sentinel internal statistics.
This extension provides callbacks when a request passes rule checking,
blocked by flow control, successfully end or exception occurred.
Accompanied by these events, response time and current thread number
will be recorded too.
Signed-off-by: Carpenter Lee <hooleeucas@163.com>
5 years ago
Jason Joo
ecf4822ae1
Make SentinelConfig.loadProps() thread-safe using CopyOnWriteArraySet ( #706 )
5 years ago
Eric Zhao
346e9b274e
Bump version to 1.6.1-SNAPSHOT
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
5 years ago
Eric Zhao
b1345f751f
Bump version to 1.6.0 (release)
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
5 years ago
Eric Zhao
82578e1fdf
Refactor and improve fallback support for @SentinelResource annotation ( #693 )
- Refactor the semantics and logic for blockHandler and fallback
- Add `fallbackClass` support for fallback in global classes
- Add `defaultFallback` support
- Update test cases and demo
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
5 years ago
Eric Zhao
bb4fde58b8
Add appType property field in SentinelConfig
- The `appType` can be retrieved from `csp.sentinel.app.type` field. It's useful to identify the service type (e.g. API gateway).
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
5 years ago
Eric Zhao
c316211faf
Add loadInstanceList support for SpiLoader
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
5 years ago
yikangfeng
08611fae0f
Add exceptionsToIgnore configuration support in @SentinelResource annotation ( #683 )
5 years ago
zhaixiaoxiang
cb9335126c
test: Fix unstable test cases in OccupiableBucketLeapArrayTest ( #687 )
5 years ago
Eric Zhao
7d344dcb95
Improve AbstractTimeBasedTest in sentinel-core
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
5 years ago
Eric Zhao
79211f055c
Add @SpiOrder annotation and update SPI loader for loading SPI with highest precedence
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
5 years ago
jason
73f166e258
Make ClusterNodeTest.testGetOrCreateOriginNodeMultiThread stable
5 years ago
jason
16082a875c
Make WarmUpRateLimiterControllerTest stable
5 years ago
Paul Kenneth Kent
4cc25429d3
Add unit tests for com.alibaba.csp.sentinel.util ( #651 )
* Add unit test for com.alibaba.csp.sentinel.util.IdUtil
* Add unit tests for com.alibaba.csp.sentinel.util.StringUtil
5 years ago
Eric Zhao
0c3bf96678
Bump version to 1.6.0-SNAPSHOT
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
5 years ago
Eric Zhao
48286e0ff8
Bump version to 1.5.1 (release)
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
5 years ago
Eric Zhao
d5204bb6a4
Ensure Error caught in InitExecutor and do not exit when error occurs in LogBase ( #613 )
to avoid affecting normal logic of users
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
5 years ago
Eric Zhao
61c525076f
Improve SentinelResourceAspect and update test cases / document of annotation support
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
5 years ago
beston123
6e1dfb374c
Add exceptionsToTrace configuration support in @SentinelResource annotation ( #543 )
5 years ago
Eric Zhao
468327bdcd
Remove useless global NodeBuilder in Env class
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
5 years ago
Carpenter Lee
7feaf709fc
Fix deadlock bug in Env static initialization ( #610 )
Signed-off-by: Carpenter Lee <hooleeucas@163.com>
5 years ago
Bo Zhang
a3369378ad
Apply Alibaba p3c pmd plugin/rules and fix/ignore all violations of priority 1 ( #574 )
5 years ago
Eric Zhao
0d4c47b23e
Bump version to 1.5.1-SNAPSHOT
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
5 years ago
Eric Zhao
053f7172a3
Bump version to 1.5.0 (release)
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
5 years ago
Eric Zhao
1741da0bab
Automatically de-duplicate rules when loading rules ( #571 )
* De-duplicate rules automatically when loading rules
* Update rule managers
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
5 years ago
Eric Zhao
044cdbb1bf
Add occupy mechanism for future buckets of sliding window to support "prioritized requests final pass" ( #568 )
* Rename: MetricsLeapArray -> BucketLeapArray
* Add implementation for `FutureBucketLeapArray`, a kind of `BucketLeapArray` that only reserves for future buckets, which is used for calculating occupied future tokens.
* Add OccupiableBucketLeapArray that combines common BucketLeapArray with FutureBucketLeapArray. The rollingNumberInSecond in StatisticNode now uses OccupiableBucketLeapArray by default.
* Add OccupySupport interface. Node now implements OccupySupport interface.
* Add occupy-related methods in Metric and ArrayMetric.
* Handle prioritized requests in default traffic shaping controller.
* Update default occupyTimeout to 500ms
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
5 years ago
Eric Zhao
4b1ccd93e2
Refactor Node interface: change return type of `xxxQps` method from long to double ( #564 )
- Update test cases (use assertEquals(e, a, delta) instead)
- Also add `totalPass` method in Node interface
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
5 years ago
Carpenter Lee
63d7c9d207
Revert "Add more overload methods in SphO and SphO" to avoid ambiguous method call
This reverts commit 35371c1
Signed-off-by: Carpenter Lee <hooleeucas@163.com>
5 years ago
Carpenter Lee
35371c1a3c
Add more overload methods in SphO and SphO
Signed-off-by: Carpenter Lee <hooleeucas@163.com>
5 years ago
Carpenter Lee
341b6426f0
Record total inbound traffic data in metric file ( #555 )
- Regard the total inbound as a "virtual node" with the name `__total_inbound_traffic__`
Signed-off-by: Carpenter Lee <hooleeucas@163.com>
5 years ago
Eric Zhao
4073053b3a
Update javadoc for core classes
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
5 years ago
Eric Zhao
775484ba61
Add try-with-resources support for Entry class ( #550 )
- `Entry` class now implements `AutoCloseable` so it supports try-with-resources (`close` method adapts to `exit`)
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
5 years ago
yikangfeng
9ec1985755
Fix SimpleDateFormat concurrent issue in CspFormatter of sentinel-core ( #548 )
5 years ago
Carpenter Lee
5279895581
Add highestCpuUsage in system rule.
Signed-off-by: Carpenter Lee <hooleeucas@163.com>
5 years ago
Eric Zhao
1ffce6b579
Fix test dependencies
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
5 years ago
Jason Joo
5d3ccb0863
Solve the issue that sleeping-based tests are not stable and optimize slow tests ( #546 )
5 years ago