Class WingsOverloadFilter.Config
-
- All Implemented Interfaces:
public class WingsOverloadFilter.Config
-
-
Field Summary
Fields Modifier and Type Field Description public longlogIntervalpublic intfallbackCodepublic StringfallbackBodypublic intrequestCapacitypublic longrequestIntervalpublic intrequestCalmdownpublic Map<String, String>requestPermitpublic longresponseWarnSlowpublic longresponseInfoStat
-
Constructor Summary
Constructors Constructor Description WingsOverloadFilter.Config()
-
Method Summary
Modifier and Type Method Description longgetLogInterval()Logging interval in millis. voidsetLogInterval(long logInterval)Logging interval in millis. intgetFallbackCode()http status of response when overload voidsetFallbackCode(int fallbackCode)http status of response when overload StringgetFallbackBody()body of response when overload voidsetFallbackBody(String fallbackBody)body of response when overload intgetRequestCapacity()fast request capacity, note that shared IP's can be easily misjudged. `<0` - unlimited, max number of requests to process `>0` - user defined value based on stress test results `0` - auto-tuning, initial value is cpu cores x 300voidsetRequestCapacity(int requestCapacity)fast request capacity, note that shared IP's can be easily misjudged. `<0` - unlimited, max number of requests to process `>0` - user defined value based on stress test results `0` - auto-tuning, initial value is cpu cores x 300longgetRequestInterval()within `interval` milliseconds, no more than `calmdown` requests can be processed for the same ip. voidsetRequestInterval(long requestInterval)within `interval` milliseconds, no more than `calmdown` requests can be processed for the same ip. intgetRequestCalmdown()within `interval` milliseconds, no more than `calmdown` requests can be processed for the same ip. voidsetRequestCalmdown(int requestCalmdown)within `interval` milliseconds, no more than `calmdown` requests can be processed for the same ip. Map<String, String>getRequestPermit()request ip whitelist, match by start-with voidsetRequestPermit(Map<String, String> requestPermit)request ip whitelist, match by start-with longgetResponseWarnSlow()slow response in millis, if exceeded, log WARN, `<0` means disable voidsetResponseWarnSlow(long responseWarnSlow)slow response in millis, if exceeded, log WARN, `<0` means disable longgetResponseInfoStat()log INFO once for each number of requests, `<0` means disable voidsetResponseInfoStat(long responseInfoStat)log INFO once for each number of requests, `<0` means disable booleanequals(@Nullable() Object o)inthashCode()StringtoString()-
-
Method Detail
-
getLogInterval
long getLogInterval()
Logging interval in millis.
-
setLogInterval
void setLogInterval(long logInterval)
Logging interval in millis.
-
getFallbackCode
int getFallbackCode()
http status of response when overload
-
setFallbackCode
void setFallbackCode(int fallbackCode)
http status of response when overload
-
getFallbackBody
String getFallbackBody()
body of response when overload
-
setFallbackBody
void setFallbackBody(String fallbackBody)
body of response when overload
-
getRequestCapacity
int getRequestCapacity()
fast request capacity, note that shared IP's can be easily misjudged. `<0` - unlimited, max number of requests to process `>0` - user defined value based on stress test results `0` - auto-tuning, initial value is cpu cores x 300
-
setRequestCapacity
void setRequestCapacity(int requestCapacity)
fast request capacity, note that shared IP's can be easily misjudged. `<0` - unlimited, max number of requests to process `>0` - user defined value based on stress test results `0` - auto-tuning, initial value is cpu cores x 300
-
getRequestInterval
long getRequestInterval()
within `interval` milliseconds, no more than `calmdown` requests can be processed for the same ip. `<=0` means no limit.
-
setRequestInterval
void setRequestInterval(long requestInterval)
within `interval` milliseconds, no more than `calmdown` requests can be processed for the same ip. `<=0` means no limit.
-
getRequestCalmdown
int getRequestCalmdown()
within `interval` milliseconds, no more than `calmdown` requests can be processed for the same ip. `<=0` means no limit.
-
setRequestCalmdown
void setRequestCalmdown(int requestCalmdown)
within `interval` milliseconds, no more than `calmdown` requests can be processed for the same ip. `<=0` means no limit.
-
getRequestPermit
Map<String, String> getRequestPermit()
request ip whitelist, match by start-with
-
setRequestPermit
void setRequestPermit(Map<String, String> requestPermit)
request ip whitelist, match by start-with
-
getResponseWarnSlow
long getResponseWarnSlow()
slow response in millis, if exceeded, log WARN, `<0` means disable
-
setResponseWarnSlow
void setResponseWarnSlow(long responseWarnSlow)
slow response in millis, if exceeded, log WARN, `<0` means disable
-
getResponseInfoStat
long getResponseInfoStat()
log INFO once for each number of requests, `<0` means disable
-
setResponseInfoStat
void setResponseInfoStat(long responseInfoStat)
log INFO once for each number of requests, `<0` means disable
-
hashCode
int hashCode()
-
-
-
-