Commit Graph

281 Commits

Author SHA1 Message Date
Lin.Liang ee38587a6e Remove redundant operation when adding child node in NodeSelectorSlot (#794) 2019-06-04 18:02:43 +08:00
Lin.Liang 3a9e2629b7 Replace AtomicInteger with LongAdder for curThreadNum of StatisticNode (#747) 2019-06-04 17:51:36 +08:00
Eric Zhao f8ebbbccf4 Bump version to 1.7.0-SNAPSHOT
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-05-25 15:07:19 +08:00
Eric Zhao 3d2c33ef1d Bump version to 1.6.1 (release)
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-05-23 09:49:15 +08:00
Carpenter Lee f3e705c5f3 Add exceptionsToTrace and exceptionsToIgnore support in Tracer (#766)
Signed-off-by: Carpenter Lee <hooleeucas@163.com>
2019-05-22 10:06:03 +08:00
Eric Zhao 54da16d304 Refactor FlowRuleChecker to improve code reuse
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-05-22 09:47:41 +08:00
yikangfeng 4ec0462e31 Add getCpuUsageThreshold() method in SystemRuleManager (#770) 2019-05-21 16:00:46 +08:00
Carpenter Lee 18d8b4c8a7
Add CPU usage and system load to metric (#749)
Signed-off-by: Carpenter Lee <hooleeucas@163.com>
2019-05-10 14:20:00 +08:00
Eric Zhao 6e4560845c Update SENTINEL_VERSION constant to 1.6.1
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-05-06 13:46:03 +08:00
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>
2019-05-06 10:55:42 +08:00
Jason Joo ecf4822ae1 Make SentinelConfig.loadProps() thread-safe using CopyOnWriteArraySet (#706) 2019-04-25 20:00:44 +08:00
Eric Zhao 346e9b274e Bump version to 1.6.1-SNAPSHOT
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-04-25 09:38:59 +08:00
Eric Zhao b1345f751f Bump version to 1.6.0 (release)
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-04-24 20:42:32 +08:00
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>
2019-04-23 23:17:03 +08:00
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>
2019-04-23 21:06:31 +08:00
Eric Zhao c316211faf Add loadInstanceList support for SpiLoader
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-04-22 11:13:38 +08:00
yikangfeng 08611fae0f Add exceptionsToIgnore configuration support in @SentinelResource annotation (#683) 2019-04-21 15:57:12 +08:00
zhaixiaoxiang cb9335126c test: Fix unstable test cases in OccupiableBucketLeapArrayTest (#687) 2019-04-20 22:28:38 +08:00
Eric Zhao 7d344dcb95 Improve AbstractTimeBasedTest in sentinel-core
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-04-20 21:04:20 +08:00
Eric Zhao 79211f055c Add @SpiOrder annotation and update SPI loader for loading SPI with highest precedence
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-04-17 14:47:09 +08:00
jason 73f166e258 Make ClusterNodeTest.testGetOrCreateOriginNodeMultiThread stable 2019-04-12 10:42:08 +08:00
jason 16082a875c Make WarmUpRateLimiterControllerTest stable 2019-04-12 10:42:08 +08:00
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
2019-04-09 09:14:51 +08:00
Eric Zhao 0c3bf96678 Bump version to 1.6.0-SNAPSHOT
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-03-27 18:00:06 +08:00
Eric Zhao 48286e0ff8 Bump version to 1.5.1 (release)
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-03-27 15:23:11 +08:00
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>
2019-03-27 10:55:04 +08:00
Eric Zhao 61c525076f Improve SentinelResourceAspect and update test cases / document of annotation support
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-03-25 14:14:31 +08:00
beston123 6e1dfb374c Add exceptionsToTrace configuration support in @SentinelResource annotation (#543) 2019-03-25 13:57:57 +08:00
Eric Zhao 468327bdcd Remove useless global NodeBuilder in Env class
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-03-25 11:48:31 +08:00
Carpenter Lee 7feaf709fc Fix deadlock bug in Env static initialization (#610)
Signed-off-by: Carpenter Lee <hooleeucas@163.com>
2019-03-25 09:22:38 +08:00
Bo Zhang a3369378ad Apply Alibaba p3c pmd plugin/rules and fix/ignore all violations of priority 1 (#574) 2019-03-15 09:24:39 +08:00
Eric Zhao 0d4c47b23e Bump version to 1.5.1-SNAPSHOT
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-03-14 16:50:53 +08:00
Eric Zhao 053f7172a3 Bump version to 1.5.0 (release)
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-03-14 15:33:57 +08:00
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>
2019-03-14 14:05:13 +08:00
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>
2019-03-14 10:04:56 +08:00
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>
2019-03-13 22:10:20 +08:00
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>
2019-03-13 11:33:26 +08:00
Carpenter Lee 35371c1a3c Add more overload methods in SphO and SphO
Signed-off-by: Carpenter Lee <hooleeucas@163.com>
2019-03-13 10:34:42 +08:00
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>
2019-03-11 18:25:45 +08:00
Eric Zhao 4073053b3a Update javadoc for core classes
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-03-11 18:07:29 +08:00
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>
2019-03-08 09:57:49 +08:00
yikangfeng 9ec1985755 Fix SimpleDateFormat concurrent issue in CspFormatter of sentinel-core (#548) 2019-03-06 20:39:33 +08:00
Carpenter Lee 5279895581 Add highestCpuUsage in system rule.
Signed-off-by: Carpenter Lee <hooleeucas@163.com>
2019-03-06 20:21:42 +08:00
Eric Zhao 1ffce6b579 Fix test dependencies
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-03-06 17:20:26 +08:00
Jason Joo 5d3ccb0863 Solve the issue that sleeping-based tests are not stable and optimize slow tests (#546) 2019-03-06 16:49:59 +08:00
ATAXGT 10d7c903cf Optimize circuit breaking state transformation using CAS in DegradeRule (#538)
close → open: use `compareAndSet` to update for `cut` attribute (changed to an `AtomicBoolean`)
2019-03-05 18:45:37 +08:00
Carpenter Lee 5d2170282f Add Sph.entryWithPriority() method to receive args
Signed-off-by: Carpenter Lee <hooleeucas@163.com>
2019-02-25 11:37:44 +08:00
mjaow 291742c171 Change default value of avgUsedTokens to zero to be more meaningful in DefaultController (#460) 2019-02-22 17:02:19 +08:00
Eric Zhao 5b260a9f75 Bump version to 1.5.0-SNAPSHOT
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-02-21 19:41:50 +08:00
Eric Zhao 2e0fe23384 Bump version to 1.4.2 (release)
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-02-20 14:15:33 +08:00
Eric Zhao 412e1ece47
Carry the triggered rule in subclasses of BlockException (#469)
* Extract getRule in BlockException and refine override methods in subclasses

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-01-31 14:24:05 +08:00
mjaow 5c0fd5651a Add volatile in double-checked locking field in ClusterBuilderSlot (#466) 2019-01-30 10:25:16 +08:00
Eric Zhao 35537a691e Refinement for test cases
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-01-29 10:28:07 +08:00
cdfive 22e8d85a8f Add some unit test for StatisticNode, ClusterNode and DefaultNodeBuilder class (#423) 2019-01-29 10:07:17 +08:00
Andres Almiray e893dd8c64 Make build faster by reducing fixed waiting time in tests (#449)
- Apply awaitility to core tests
- Cache maven local repo in Travis
2019-01-29 09:57:38 +08:00
Eric Zhao cd334406af Code and javadoc refinement
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-01-28 16:22:34 +08:00
luoxiangnan f306a03090 HashMap init optimize when adding new ClusterNode to cluster node map (#465)
- reuse old map size to avoid rearrange and rehash the map
2019-01-28 15:47:39 +08:00
mjaow 2cf6e29e72 Fix zero-count divide overflow bug in RateLimiterController (#461) 2019-01-28 14:23:41 +08:00
mjaow 223ad252df Remove duplicate comment in WarmUpController (#464) 2019-01-28 11:44:31 +08:00
mjaow 30907e4c9d Fix error value type and rename variable in EntranceNode class (#457) 2019-01-26 10:44:10 +08:00
Eric Zhao ba4fdcc638 Fixes #453: Support tracing exception count for specific entry or context in Tracer
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-01-25 16:34:17 +08:00
Eric Zhao 8e72211db9 Add catch throwable logic in ClusterStateManager to detect fatal error when loading SPI
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-01-25 13:48:31 +08:00
Carpenter Lee c45d64c619 Bug fix: fix 420, fix negative waitTime in RateLimiterController and WarmUpRateLimiterController
Signed-off-by: Carpenter Lee <hooleeucas@163.com>
2019-01-16 15:21:16 +08:00
kexianjun 9697c06739 Fix incorrect comment in NodeSelectorSlot javadoc (#419) 2019-01-15 17:18:07 +08:00
kangyl 47148acc1e Remove redundant semicolon in MetricWriter (#412) 2019-01-14 17:54:31 +08:00
Eric Zhao d4d85dbc7c Bump version to 1.4.2-SNAPSHOT
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-01-04 19:08:07 +08:00
Eric Zhao 225d81ed93 Bump version to 1.4.1
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-01-04 14:59:50 +08:00
Eric Zhao 40368bdcd6 Config and log enhancement for cluster token client
- Refactor token client common config and assign config
- Log enhancement when transport to token server failed
- Add `getState` method to `ClusterTokenClient` interface

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-01-04 14:13:21 +08:00
Eric Zhao 25e96a8cd3 Improve cluster state manager
- Support stop cluster mode (`NOT-STARTED` mode)
- Fix bug when updating cluster state via command API (should modify via state property)

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-01-04 14:09:29 +08:00
Eric Zhao 99bdb9cf3c
Add total QPS limit control for specific namespace in cluster flow control (#382)
- Add `UnaryLeapArray` and `RequestLimiter` to enable simple QPS limit
- Improve cluster rule manager and server config manager to support request limiter
- Support `TOO_MANY_REQUEST` status in client side
- Also improve the automatic namespace register of embedded server mode

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-01-04 14:09:15 +08:00
Eric Zhao 8d84349607 Add returning modified status of `updateProperty` method in SentinelProperty
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-01-04 13:04:47 +08:00
Eric Zhao 9165fe0d61
Support multiple tokens per request entry (#380)
- Refactor MetricBucket to support add multiple count
- Refactor Node and Metric related classes
- Refactor for StatisticSlot

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-01-04 13:02:11 +08:00
cdfive 44409182ae Make the default statistic max RT value `TIME_DROP_VALVE` configurable (#292)
@see https://github.com/alibaba/Sentinel/issues/276
2018-12-29 09:52:18 +08:00
Zhe Jiang 197c982c02 doc: fix SphO document typo (#357) 2018-12-28 18:41:26 +08:00
Eric Zhao f046194d6b Add sampleCount and windowInterval item to cluster config of flow rule and param rule
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-12-25 11:44:40 +08:00
Carpenter Lee c047457c2f
Fix/list metric files (#331)
* Fix #330 : fix listMetricFiles() returns wrong file name list.

Signed-off-by: Carpenter Lee <hooleeucas@163.com>

* Add timestamp check when read metrics.

Signed-off-by: Carpenter Lee <hooleeucas@163.com>

* Refine test case

Signed-off-by: Carpenter Lee <hooleeucas@163.com>
2018-12-25 09:31:18 +08:00
Eric Zhao d3bbe290c2
Refinement for heartbeat logic in sentinel-transport related module (#312)
- Code refinement for heartbeat component in transport related module
- Add remove support of `SentinelConfig`

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-12-24 18:03:31 +08:00
Eric Zhao a2b91a9030 Refactor the constructor and units of LeapArray and related statistic class
- The constructor now accept `sampleCount` and `windowIntervalMs` so that it can match the two basic properties

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-12-24 18:02:50 +08:00
leitao e5cc277f0a Remove duplicate class in sentinel-core (#309)
ClusterTokenClient.java,TokenClientProvider.java in package `com.alibaba.csp.sentinel.cluster`
2018-12-17 14:14:16 +08:00
Eric Zhao 9916dad403 Bump version to 1.4.1-SNAPSHOT
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-12-17 10:23:19 +08:00
Eric Zhao c7b5653249 Bump version to 1.4.0
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-12-14 14:59:27 +08:00
Eric Zhao 465b44b7e7
Merge branch 'master' into feature/cluster-flow-control 2018-12-14 10:58:20 +08:00
Eric Zhao 2735954afd Update cluster related command APIs and some enhancement and fix for cluster module
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-12-14 10:54:30 +08:00
Eric Zhao a5819e092d Add HTTP command for modifying global state and client config
- Add several command handlers
- Update cluster state manager

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-12-14 10:54:30 +08:00
Eric Zhao 9314fca8a6 Add cluster state manager to manage cluster mode
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-12-14 10:52:28 +08:00
Eric Zhao e31e7e0208 Update cluster related logic in core
- Remove "borrow-from-ref" mode
- Improve flow checker to support both embedded server mode and client mode

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-12-14 10:52:28 +08:00
Eric Zhao ba72d4c67a Rearrangement and refinement of statistic code in core
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-12-14 10:52:28 +08:00
Eric Zhao 9d42edcffa Add cluster token server interface to core and support embedded mode
- Add a EmbeddedClusterTokenServer interface

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-12-14 10:52:28 +08:00
Eric Zhao 9f2678eb6c Update token client interface in sentinel-core
- Add `start` and `stop` method for automatic control
- Update TokenClientProvider using SpiLoader

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-12-14 10:52:28 +08:00
Eric Zhao f83ea428ff Update token client interface and default implementation
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-12-14 10:52:28 +08:00
Eric Zhao b3ae7f58bf Add common module for Sentinel default cluster implementation
- Add a `ClusterTransportClient` for transport abstraction of Sentinel cluster
- Add universal request/response interface and common ClusterRequest/ClusterResponse abstraction
- Add common request/response data entity
- Add basic abstraction of codec (EntityWriter and EntityDecoder)

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-12-14 10:52:21 +08:00
Eric Zhao 1043648fbc Update parameter flow rule to adapt to cluster mode and extract rule util class
- Update ParamFlowRule to support cluster mode
- Add `ParamFlowClusterConfig` to provide cluster mode items for the rule
- Update ParamFlowChecker to support cluster flow mode
- Extract ParamFlowRuleUtil class
- Change type of `flowId` from Integer to Long

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-12-14 10:52:21 +08:00
Eric Zhao b215e8784e Update flow rule for cluster mode and extract util class
- Add new field `clusterMode` and `clusterConfig` for cluster mode
- Add a `ClusterFlowConfig` class for specific items for cluster flow control
- Update FlowRuleChecker to support cluster mode
- Extract valid rule checking and rule map generating logic to FlowRuleUtil

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-12-14 10:52:21 +08:00
Eric Zhao 6545a90d46 Add basic interface and entity for Sentinel cluster flow control
- Add a universal `TokenService` SPI interface for both local flow control and distributed flow control
- Add TokenResult entity to represents result of acquiring token
- Add `ClusterTokenClient` as the SPI interface for client of Sentinel cluster flow control

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-12-14 10:52:21 +08:00
leitao 512b27bba3 Fix javadoc typo in decreaseThreadNum() method of Node interface (#296) 2018-12-11 11:56:45 +08:00
Eric Zhao c80bb5a862
Merge pull request #257 from alibaba/feature/cluster-core
Add basic interface and adaptations for Sentinel cluster flow control in `sentinel-core` (#257)
2018-11-23 16:12:54 +08:00
Eric Zhao 4342b1e935 Code refinement for LeapArray
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-11-23 11:13:32 +08:00
Eric Zhao f539b5b827 Update parameter flow rule to adapt to cluster mode and extract rule util class
- Update ParamFlowRule to support cluster mode
- Add `ParamFlowClusterConfig` to provide cluster mode items for the rule
- Update ParamFlowChecker to support cluster flow mode
- Extract ParamFlowRuleUtil class
- Change type of `flowId` from Integer to Long

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-11-23 10:13:59 +08:00
Eric Zhao a6534e5b13 Update flow rule for cluster mode and extract util class
- Add new field `clusterMode` and `clusterConfig` for cluster mode
- Add a `ClusterFlowConfig` class for specific items for cluster flow control
- Update FlowRuleChecker to support cluster mode
- Extract valid rule checking and rule map generating logic to FlowRuleUtil

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-11-21 19:06:44 +08:00
Eric Zhao d6237bee0a Add basic interface and entity for Sentinel cluster flow control
- Add a universal `TokenService` SPI interface for both local flow control and distributed flow control
- Add TokenResult entity to represents result of acquiring token
- Add `ClusterTokenClient` as the SPI interface for client of Sentinel cluster flow control

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-11-21 19:06:11 +08:00
Eric Zhao 7bf2a809e9 Code and javadoc improvement
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-11-21 17:37:43 +08:00
Eric Zhao 09ba7f081b Resolves #256: Support parameters in entry of Sentinel annotation support
- To enable parameter flow control in Sentinel annotation support

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-11-21 16:46:55 +08:00
Eric Zhao 2237727a11
Add prioritized entry support in ProcessorSlot and SphU (#255)
- Refactor the slot interface to support prioritized entry
- Add `entryWithPriority` in SphU

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-11-21 16:22:41 +08:00
Eric Zhao f2a401cdb3 Code and javadoc refinement
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-11-20 20:52:03 +08:00
Eric Zhao f8bc6f631a Code and javadoc refinement
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-11-20 20:06:55 +08:00
Eric Zhao c42ba34568 Add basic helper functional interface
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-11-19 14:39:31 +08:00
Eric Zhao 6765130f1b Add log for fatal error when InitExecutor failed
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-11-15 17:09:23 +08:00
Eric Zhao a680b4c5e3 Add sort for flow rules when loading rules
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-11-15 17:04:33 +08:00
Eric Zhao 1ca28d8974 Update test cases for flow slot and checker
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-11-14 14:52:39 +08:00
Eric Zhao d4d63fad95 Extract flow rule checker from FlowRule
- Extract flow rule checker from legacy `passCheck`
- Remove redundant code
- Refactor FlowSlot (some logic moved from FlowRuleManager)
- Rename `Controller` to `TrafficShapingController`

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-11-14 14:52:39 +08:00
Carpenter Lee 08f2a71f4e Add "warmup with rate limiting" implementation for traffic shaping (#220)
- Add a new kind of control behavior `warm up + rate limiter`, behaving as both warm up and pace control
2018-11-01 17:10:13 +08:00
Eric Zhao df84b6b41e Update javadoc and code refinement for AbstractRule
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-11-01 10:36:49 +08:00
Eric Zhao bffa4ff777 Bump version to 1.4.0-SNAPSHOT
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-10-30 16:06:32 +08:00
Eric Zhao f4b5fae130 Bump version to 1.3.0-GA and update dependencies
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-10-30 15:01:51 +08:00
Eric Zhao 0c15dd9fe3
Fixes #198: Enhance rule checking in rule managers and Sentinel Dashboard (#202)
- Enhance rule checking in rule managers and Sentinel Dashboard frontend
- Enhance error information when reporting invalid fields in rule dialog

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-10-29 13:35:06 +08:00
Eric Zhao 531578ce54 Bump version to 1.3.0-SNAPSHOT
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-10-24 15:52:11 +08:00
Eric Zhao 5aad448191 Refactor logic of getting resource name in Sentinel annotation
- Enhance resolve name logic in MethodUtil
- Add test case for MethodUtil

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-10-24 14:46:42 +08:00
waveng 078df9db4f Sentinel annotation supports method name as default resource name (#187) 2018-10-24 09:42:51 +08:00
Carpenter Lee 85c844eb9c
Config whether pid is needed in the log file name (#194)
- Change log file name;
- Add configurability to log file name and metric file name.
2018-10-23 19:03:23 +08:00
Carpenter Lee bbea62a5c7 Add StringUtil.capitalize() method 2018-10-19 11:04:30 +08:00
Carpenter Lee b85d8ef1db Change behavior when exception occurred in InitExecutor. Will not call System.exit(), just print stack trace 2018-10-16 20:24:02 +08:00
Eric Zhao 7626bf4a49 Code enhancement for #161
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-10-16 17:06:36 +08:00
Carpenter Lee ba10d10aa9
Bug fix: fix wrong log file name checking (#182) 2018-10-16 17:03:22 +08:00
jasonjoo2010 0916a9bfa2 Enhancements in transport-netty-http and properties related (#161)
* sentinel-transport-netty-http will also retry when port specified has been used
* LogBase support variable arguments
* Remove duplicated JVM properties overriding in SentinelConfig
* Add VersionUtil to get version from jar
2018-10-16 11:23:53 +08:00
李豪 9ae079c152
Support degrade by exception count (#174)
* Add a new DegradeRule type, degrade by exception count in the last 60 seconds
* Add demo about degrading by exception count
2018-10-11 16:39:38 +08:00
Carpenter Lee 570c3ee5b7 Change intervalInSec of StatisticNode.rollingCounterInMinute to 60 seconds 2018-10-11 14:24:33 +08:00
李豪 03922dbf6c
Enhancement/normalize metric field (#170)
normalize metric fields and methods:
- rename exception to exceptionQps;
- remove ed postfix of all fields and methods about metrics;
2018-10-11 09:28:43 +08:00
Carpenter Lee 85540229e9 Change eagleEye log path when log base configured. 2018-10-08 19:46:38 +08:00
Carpenter Lee 4610bd3da6 Use System property to config log base dir
Signed-off-by: Carpenter Lee <hooleeucas@163.com>
2018-10-08 16:23:05 +08:00
Eric Zhao 94dc7966ae Bump version to 0.2.1-SNAPSHOT
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-09-28 17:18:41 +08:00
Eric Zhao 1063974ceb Bump version to 0.2.0
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-09-27 17:59:23 +08:00
Eric Zhao 9c2683e6ba Log warn when amount of context exceeds the max capacity for the first time
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-09-27 16:53:07 +08:00
Eric Zhao 87076a6977 Code and javadoc refinement
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-09-27 16:51:30 +08:00
Eric Zhao 88a02623ac
Add flow control by frequent (hot spot) parameters (#156)
- Add callback registry for statistic slot for extensions.
- Add a new module `sentinel-parameter-flow-control` under `sentinel-extension`.
- Add a `CacheMap` interface to provide abstraction for cache. We use ConcurrentLinkedHashMap as the default implementation (LRU strategy)..
- Add a `ParameterMetric` class as frequent parameter metrics for a specific resource. The metric map is located in `ParamFlowSlot` rather than `ClusterNode`.
- Implement `ParameterLeapArray` as statistic data structure for frequent parameters in a period of time window.
- Add `ParamFlowSlot` as the checker slot; Add `ParamFlowChecker` to do rule checking; Add `ParamFlowRuleManager` to do rule managing.
- The statistic metrics for frequent parameters is enabled only if the related resource has configured parameter flow rule; Parameter metrics for removed rules will be cleared automatically.
- Leverage extensible `SlotChainBuilder` to provide a `HotParamSlotChainBuilder`.
- Add command handlers for hot param rules.
- Add test cases and demo.
2018-09-27 14:15:47 +08:00
Eric Zhao 9e012d2e20 Refactor version representation and add client version to heartbeat
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-09-25 16:52:28 +08:00
Eric Zhao 7c179bb592 Update integration test and demo for async entry
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-09-25 11:43:23 +08:00
Eric Zhao e50fc55d68 Add more test cases for Sentinel core internal (e.g. Entry, CtSph)
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-09-20 23:23:46 +08:00
Eric Zhao fe6b4f4865 Some code update and rearrangement
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-09-20 23:22:52 +08:00
Eric Zhao 62decf0464 Some bug fixes and enhancement for async entry support
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-09-20 23:20:53 +08:00
Eric Zhao cbaacfda55 Bug fix for automatic exit of default context when exiting the entry
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-09-20 23:19:50 +08:00
Eric Zhao be43a31dc4
Fix internal bug when amount of context exceeds the threshold (#152)
- When amount of context exceeds the threshold, the `NullContext` will be set to current thread local. Thus, when checking context in `CtSph#entry`, once `NullContext` detected, the entry will not do rule checking on the slot chain.
- Cache the default context during initialization. Then when amount of context exceeds the threshold, entries under default context can do rule checking under default context.
- Enhance the error message

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-09-19 14:01:07 +08:00
Carpenter Lee 91f27977e9 1. Refector SampleCountProperty and IntervalProperty;
2. Add more java doc for LeapArray.
2018-09-17 14:15:12 +08:00
Eric Zhao 015efe2f9b Separate checking logic from AuthorityRule and add test cases
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-09-17 11:41:51 +08:00
Carpenter Lee b5b3f6edee Bug fix: fix probability of metric lose 2018-09-16 21:13:06 +08:00
Eric Zhao b1f33675c5 Improvements for Redis data source and demo
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-09-14 15:02:55 +08:00
Eric Zhao 5edac71fef
Add support for asynchronous invocation entry (#146)
- Add several `asyncEntry` method in `Sph` interface and `SphU` class.
- Add a new `AsyncEntry` class for asynchronous entry representation. Some refactor for `CtEntry`.
- Refactored `CtSph` and implement `asyncEntryInternal` for asynchronous entry.
- Add `runOnContext` and `replaceContext` method in `ContextUtil` for context switching.
2018-09-14 10:07:27 +08:00
Eric Zhao 54905497d0 Refactor LeapArray to reuse code for current bucket
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-09-12 19:17:25 +08:00
Eric Zhao 2a3e33590f Update test cases and demo for async support
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-09-12 18:53:24 +08:00
Eric Zhao ca2f4d9fae
Support extensible slot chain builder using SPI mechanism (#145)
- Support extensible `SlotChainBuilder` using SPI mechanism
- Add a `SlotChainProvider` to load slot chain builder and create new slot chains

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-09-12 13:53:43 +08:00
Eric Zhao d798794ab3 Refactor the context and entry to support asynchronous invocation chain
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-09-12 11:46:21 +08:00