aegis
aegis copied to clipboard
[feature] Support defining startup threshold through inteface
Background: I plan to use the API average RT (response time) or P95 RT as the adaptive current limiting startup threshold. But the current code design makes it difficult for me to implement this function.
My thoughts: By defining the startup threshold interface, and supporting passing in limiter during initialization.
e.x.
type StartupThreshold interface {
Reach()
}
func (l *BBR) shouldDrop() bool {
now := time.Duration(time.Now().UnixNano())
//
if ! l.StartupThreshold.Reach() {
// do sth when not reach threshold
}
// do sth when reach threshold
// drop ...
}
It seems like you've got this under control, if you want help or have specific questions, let me know what I can do for you!
About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
If you want to continue the conversation, start your reply with @dosu-bot.