Commit Graph

94 Commits

Author SHA1 Message Date
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
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 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