Logger and Leaks
This commit is contained in:
parent
91fa727c74
commit
38a4c80995
11 changed files with 108 additions and 82 deletions
6
vendor/github.com/vulcand/oxy/cbreaker/ratio.go
generated
vendored
6
vendor/github.com/vulcand/oxy/cbreaker/ratio.go
generated
vendored
|
@ -34,17 +34,17 @@ func (r *ratioController) String() string {
|
|||
}
|
||||
|
||||
func (r *ratioController) allowRequest() bool {
|
||||
log.Infof("%v", r)
|
||||
log.Debugf("%v", r)
|
||||
t := r.targetRatio()
|
||||
// This condition answers the question - would we satisfy the target ratio if we allow this request?
|
||||
e := r.computeRatio(r.allowed+1, r.denied)
|
||||
if e < t {
|
||||
r.allowed++
|
||||
log.Infof("%v allowed", r)
|
||||
log.Debugf("%v allowed", r)
|
||||
return true
|
||||
}
|
||||
r.denied++
|
||||
log.Infof("%v denied", r)
|
||||
log.Debugf("%v denied", r)
|
||||
return false
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue