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/cbreaker.go
generated
vendored
6
vendor/github.com/vulcand/oxy/cbreaker/cbreaker.go
generated
vendored
|
@ -126,7 +126,7 @@ func (c *CircuitBreaker) activateFallback(w http.ResponseWriter, req *http.Reque
|
|||
c.m.Lock()
|
||||
defer c.m.Unlock()
|
||||
|
||||
log.Infof("%v is in error state", c)
|
||||
log.Warnf("%v is in error state", c)
|
||||
|
||||
switch c.state {
|
||||
case stateStandby:
|
||||
|
@ -197,7 +197,7 @@ func (c *CircuitBreaker) exec(s SideEffect) {
|
|||
}
|
||||
|
||||
func (c *CircuitBreaker) setState(new cbState, until time.Time) {
|
||||
log.Infof("%v setting state to %v, until %v", c, new, until)
|
||||
log.Debugf("%v setting state to %v, until %v", c, new, until)
|
||||
c.state = new
|
||||
c.until = until
|
||||
switch new {
|
||||
|
@ -230,7 +230,7 @@ func (c *CircuitBreaker) checkAndSet() {
|
|||
c.lastCheck = c.clock.UtcNow().Add(c.checkPeriod)
|
||||
|
||||
if c.state == stateTripped {
|
||||
log.Infof("%v skip set tripped", c)
|
||||
log.Debugf("%v skip set tripped", c)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
2
vendor/github.com/vulcand/oxy/cbreaker/effect.go
generated
vendored
2
vendor/github.com/vulcand/oxy/cbreaker/effect.go
generated
vendored
|
@ -73,6 +73,6 @@ func (w *WebhookSideEffect) Exec() error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
log.Infof("%v got response: (%s): %s", w, re.Status, string(body))
|
||||
log.Debugf("%v got response: (%s): %s", w, re.Status, string(body))
|
||||
return nil
|
||||
}
|
||||
|
|
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