| 限定符和类型 | 字段和说明 |
|---|---|
static String |
CONCURRENCY
并发量,通过 Semaphore 来实现
和并发有关,和请求时间无关
|
static String |
IP_CONCURRENCY
IP 并发量限制,通过 Semaphore 来实现
和并发有关,和请求时间无关
|
static String |
IP_TOKEN_BUCKET
IP 并发量限制,通过 RateLimiter 来实现
每个 ip 在每 1 秒内允许请求的数量
|
static String |
TOKEN_BUCKET
令牌桶,通过 guava 的 RateLimiter 来实现
时间有关,每秒钟允许有多少个请求
|
static Set<String> |
types |
| 构造器和说明 |
|---|
LimitType() |
public static final String TOKEN_BUCKET
public static final String IP_TOKEN_BUCKET
public static final String CONCURRENCY
public static final String IP_CONCURRENCY
public LimitType()
Copyright © 2024. All rights reserved.