浏览代码

Update documentation and issue template

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
master
Eric Zhao 6 年前
父节点
当前提交
e322df2d32
共有 5 个文件被更改,包括 44 次插入23 次删除
  1. +2
    -0
      .github/ISSUE_TEMPLATE.md
  2. +21
    -22
      README.md
  3. +1
    -1
      sentinel-adapter/sentinel-dubbo-adapter/README.md
  4. +19
    -0
      sentinel-adapter/sentinel-web-servlet/README.md
  5. +1
    -0
      sentinel-demo/README.md

+ 2
- 0
.github/ISSUE_TEMPLATE.md 查看文件

@@ -1,6 +1,8 @@
<!-- Here is for bug reports and feature requests ONLY!

If you're looking for help, please check our mail list and the Gitter room.

Please try to use English to describe your issue, or at least provide a snippet of English translation.
-->

## Issue Description


+ 21
- 22
README.md 查看文件

@@ -3,41 +3,42 @@
# Sentinel: Sentinel of Your Application

[![Travis Build Status](https://travis-ci.org/alibaba/Sentinel.svg?branch=master)](https://travis-ci.org/alibaba/Sentinel)
[![codecov](https://codecov.io/gh/alibaba/Sentinel/branch/master/graph/badge.svg)](https://codecov.io/gh/alibaba/Sentinel)
[![Codecov](https://codecov.io/gh/alibaba/Sentinel/branch/master/graph/badge.svg)](https://codecov.io/gh/alibaba/Sentinel)
[![Maven Central](https://img.shields.io/maven-central/v/com.alibaba.csp/sentinel-core.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:com.alibaba.csp%20AND%20a:sentinel-core)
[![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)
[![Gitter](https://badges.gitter.im/alibaba/Sentinel.svg)](https://gitter.im/alibaba/Sentinel)

## What Does It Do?

As distributed systems become increasingly popular, the stability between services is becoming more important than ever before. Sentinel takes "flow" as breakthrough point, and works on multiple fields including **flow control**, **concurrency**, **circuit breaking** and **load protection**, to protect service stability.
As distributed systems become increasingly popular, the reliability and stability between services is becoming more important than ever before. Sentinel takes "flow" as breakthrough point, and works on multiple fields including **flow control**, **concurrency**, **circuit breaking** and **load protection**, to protect service reliability.

Sentinel has the following features:

* **Rich applicable scenarios**:
Sentinel has been wildly used in Alibaba, and has covered almost all the core-scenarios in Double-11 Shopping Festivals in the past 10 years, such as “Second Kill” which needs to limit burst flow traffic to meet the system capacity, message peak clipping and valley fills, degrading unreliable downstream applications, etc.
- **Rich applicable scenarios**:
Sentinel has been wildly used in Alibaba, and has covered almost all the core-scenarios in Double-11 (11.11) Shopping Festivals in the past 10 years, such as “Second Kill” which needs to limit burst flow traffic to meet the system capacity, message peak clipping and valley fills, degrading unreliable downstream applications, etc.

* **Integrated monitor module**:
Sentinel also provides real-time monitoring function. You can see the runtime information of a single machine in real-time, and the summary runtime info of a cluster with less than 500 nodes.
- **Real-time monitoring**:
Sentinel also provides real-time monitoring ability. You can see the runtime information of a single machine in real-time, and the aggregated runtime info of a cluster with less than 500 nodes.

* **Easy extension point**:
Sentinel provides easy-to-use extension points that allow you to quickly customize your logic, for example, custom rule management, adapting data sources, and so on.
- **Widespread open-source ecosystem**:
Sentinel provides out-of-box integrations with commonly-used frameworks and libraries such as Spring Cloud, Dubbo and gRPC. You can easily use Sentinel by simply add the adapter dependency to your services.

- **Various SPI extensions**:
Sentinel provides easy-to-use SPI extension interfaces that allow you to quickly customize your logic, for example, custom rule management, adapting data sources, and so on.

## Documentation

See the [中文文档](https://github.com/alibaba/Sentinel/wiki/%E4%BB%8B%E7%BB%8D) for Chinese readme.

See the [Wiki](https://github.com/alibaba/Sentinel/wiki) for full documentation, examples, operational details and other information.

See the [Javadoc](https://github.com/alibaba/Sentinel/tree/master/doc) for the API.
See the [Wiki](https://github.com/alibaba/Sentinel/wiki) for full documentation, examples, blog posts, operational details and other information.

**If you are using Sentinel, please [leave a comment here](https://github.com/alibaba/Sentinel/issues/18) to tell us your use scenario to make Sentinel better :-)**
**If you are using Sentinel, please [leave a comment here](https://github.com/alibaba/Sentinel/issues/18) to tell us your scenario to make Sentinel better :-)**

## Quick Start

Below is a simple demo that guides new users to use Sentinel in just 3 steps. It also shows how to monitor this demo using the dashboard.

### 1.Download Library
### 1. Add Dependency

**Note:** Sentinel requires Java 6 or later.

@@ -53,10 +54,9 @@ If your application is build in maven, just add the following code in pom.xml.

If not, you can download JAR in [Maven Center Repository](https://mvnrepository.com/artifact/com.alibaba.csp/sentinel-core).

### 2. Define Resource

### 2.Define Resource

Wrap code snippet via Sentinel API: `SphU.entry("RESOURCENAME")` and `entry.exit()`. In below example, it is `System.out.println("hello world");`:
Wrap code snippet via Sentinel API: `SphU.entry("resourceName")` and `entry.exit()`. In below example, it is `System.out.println("hello world");`:

```java
Entry entry = null;
@@ -78,7 +78,7 @@ try {

So far the code modification is done.

### 3.Define Rules
### 3. Define Rules

If we want to limit the access times of the resource, we can define rules. The following code defines a rule that limits access to the reource to 20 times per second at the maximum.

@@ -95,7 +95,7 @@ FlowRuleManager.loadRules(rules);

### 4. Check the Result

After running the demo for a while, you can see the following records in `~/logs/csp/${appName}-metrics.log.xxx`.
After running the demo for a while, you can see the following records in `~/logs/csp/${appName}-metrics.log`.

```
|--timestamp-|------date time----|--resource-|p |block|s |e|rt
@@ -106,7 +106,7 @@ After running the demo for a while, you can see the following records in `~/logs
1529998908000|2018-06-26 15:41:48|hello world|20|19502|20|0|0
1529998909000|2018-06-26 15:41:49|hello world|20|18386|20|0|0

p stands for incoming request, block for intercepted by rules, success for success handled, e for exception, rt for average response time (ms)
p stands for incoming request, block for blocked by rules, success for success handled by Sentinel, e for exception count, rt for average response time (ms)
```
This shows that the demo can print "hello world" 20 times per second.

@@ -116,7 +116,7 @@ The working principles of Sentinel can be found in [How it works](https://github

Samples can be found in the [sentinel-demo](https://github.com/alibaba/Sentinel/tree/master/sentinel-demo) module.

### 5.Start Dashboard
### 5. Start Dashboard

Sentinel also provides a simple dashboard application, on which you can monitor the clients and configure the rules in real time.

@@ -134,5 +134,4 @@ Contact us: sentinel@linux.alibaba.com

## Contributing

Contributions are always welcomed! Please see [CONTRIBUTING](./CONTRIBUTING.md) for detailed guidelines.

Contributions are always welcomed! Please see [CONTRIBUTING](./CONTRIBUTING.md) for detailed guidelines.

+ 1
- 1
sentinel-adapter/sentinel-dubbo-adapter/README.md 查看文件

@@ -56,7 +56,7 @@ If the consumer does not use Sentinel Dubbo Adapter but requires flow control ba

## Global fallback

Since version 0.1.1, Sentinel Dubbo Adapter supports global fallback configuration.
Sentinel Dubbo Adapter supports global fallback configuration.
The global fallback will handle exceptions and give replacement result when blocked by
flow control, degrade or system load protection. You can implement your own `DubboFallback` interface
and then register to `DubboFallbackRegistry`. If no fallback is configured, Sentinel will wrap the `BlockException`


+ 19
- 0
sentinel-adapter/sentinel-web-servlet/README.md 查看文件

@@ -24,6 +24,25 @@ To use the filter, you can simply configure your `web.xml` with:
</filter-mapping>
```

For Spring web applications you can configure with Spring bean:

```java
@Configuration
public class FilterConfig {

@Bean
public FilterRegistrationBean sentinelFilterRegistration() {
FilterRegistrationBean<Filter> registration = new FilterRegistrationBean<>();
registration.setFilter(new CommonFilter());
registration.addUrlPatterns("/*");
registration.setName("sentinelFilter");
registration.setOrder(1);

return registration;
}
}
```

When a request is blocked, Sentinel servlet filter will give a default page indicating the request blocked.
If customized block page is set (via `WebServletConfig.setBlockPage(blockPage)` method),
the filter will redirect the request to provided URL. You can also implement your own


+ 1
- 0
sentinel-demo/README.md 查看文件

@@ -7,3 +7,4 @@ The examples demonstrate:
- How to use Dubbo with Sentinel
- How to use Apache RocketMQ client with Sentinel
- How to use Sentinel annotation support
- How to add your own logic to Sentinel using Slot Chain SPI

正在加载...
取消
保存