Commit Graph

88 Commits

Author SHA1 Message Date
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 5f5443a546 Update sample count for ParameterMetric
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-09-27 14:28:05 +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 8c2cceca5e Add config for Codecov
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-09-26 15:15:24 +08:00
Eric Zhao cf1cf8a59f Update dependencies
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-09-26 15:03:19 +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 90d5611b23 Update Sentinel Web Servlet integration
- Add RequestOriginParser interface to extract request origin from the HTTP request
- Some code refinement

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-09-20 23:19:17 +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
moon tiger 4ff2e37abb Add DataSource integration for Redis (#102)
- This implementation uses Lettuce as the internal client, and leverages Redis pub-sub feature to implement push mode data source. (by @tigerMoon)
2018-09-14 14:08:50 +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
Eric Zhao d142a07a39 Enhance log and null check for rule managers
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-09-10 15:44:42 +08:00
Eric Zhao 02cf5e5639
Add MetricsRepository interface and reuse original in-memory implementation (#126)
- Abstract a universal `MetricsRepository` interface so that users can implement their own metrics persistence.
- Reuse original in-memory implementation (`InMemoryMetricsRepository`) as the default repository.

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-09-06 18:59:31 +08:00
Eric Zhao ed30f85f9c Fixes #128: Fix early return when exception ratio is 100%
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-09-05 19:03:27 +08:00
Eric Zhao 50a5610010 Enhance file data source and flow rule manager
- Some refinement for file data source
- Add resource name checking in FlowRuleManager to avoid NPE

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-09-05 15:45:52 +08:00
yfh0918 175452a96a Enhance FileRefreshableDataSource and FileWritableDataSource (#125)
- Add method to check if the resource is modified in `AutoRefreshDataSource`
- Implement FileWritableDataSource
2018-09-05 12:36:46 +08:00
Eric Zhao 9a27f395e6 Some structure refactor for Sentinel Dashboard
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-09-04 19:09:19 +08:00
Eric Zhao 007cd9d291 Some refactor of data source
- Add `close` method in WritableDataSource (to extend AutoCloseable in JDK 1.7 later)
- Separate the writable file data source from original class
- Add a sample to show how to register data sources via Sentinel init mechanism
- Separate a writable data source registry from original handler to make it clear

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-09-04 11:09:42 +08:00
Eric Zhao f3eb285445 Update demo of various data source to adapt to new changes
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-09-04 11:09:42 +08:00
Eric Zhao c70d6e92bc Update command handler for modifying rules
- Refine code about writable datasource

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-09-04 11:09:42 +08:00
Eric Zhao 0060e8042a Refactor Sentinel data source hierarchy
- Spilt DataSource into two types: ReadableDataSource and WritableDataSource
- The AbstractDataSource now is read-only
- Refactor the file data source for writable implementation
- Rename: ConfigParser -> Converter (represents both encoder `T -> S` and decoder `S -> T`)
- Some other refinement

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-09-04 11:09:42 +08:00
Carpenter Lee 6799da270d Fixed #109: fix miss-usage of ClusterNode.successQps() in DegradeRule.passCheck() method 2018-09-03 11:54:59 +08:00
Eric Zhao f70ab5ab05 Fixes #117: Update document of Sentinel Dashboard
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-09-03 09:33:03 +08:00
Eric Zhao 9164bb19fe
Fix the bug when resolving original method to get annotation (#111)
- The method from the signature will return the method of interface, so we need to resolve declared method in target class

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-08-31 11:10:41 +08:00
refactormachine b61be268a3 Refactor test cases for Sentinel gRPC Adapter (#101)
- Added a GrpcTestServer to abstract common server logic
- Refactor with new added `GrpcTestServer`
2018-08-30 23:57:23 +08:00
Shalti 2772f189ab Fixed CR comments 2018-08-29 21:19:16 +08:00
Shalti dc0a7086b5 Renamed to MetricsReader 2018-08-29 21:19:16 +08:00
Shalti ac8698ed9f Refactored some classes 2018-08-29 21:19:16 +08:00
Carpenter Lee d716f0f14a Fixes #99, fix miss comparison of FlowRule.maxQueueingTimeMs 2018-08-29 17:48:04 +08:00
子矜 cedd420336 jialianglinjl 2018-08-29 15:33:33 +08:00
kimmking f8a72c4931 update README to add coverage icon
update README to add coverage icon
2018-08-24 12:48:35 +08:00
Eric Zhao f6484514ff Add benchmark for Sentinel
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-08-17 11:44:15 +08:00
Eric Zhao 23f65b9fee Update dependencies and add log
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-08-17 11:17:24 +08:00
Eric Zhao 94aea568f6 Miscellaneous update
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-08-15 15:33:29 +08:00
Eric Zhao 49097fa45c Resolves #61: Enhance exception trace in Sentinel Dubbo Adapter
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-08-15 15:16:33 +08:00