Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

Commit

Permalink
Inhibit slow logging when isolated
Browse files Browse the repository at this point in the history
  • Loading branch information
bartelink committed Oct 25, 2018
1 parent 04737a2 commit 3fa091e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/CallPolly/Rules.fs
Original file line number Diff line number Diff line change
Expand Up @@ -181,17 +181,18 @@ type Governor
match config.cutoff with
| None | Some { sla=None; dryRun=false } ->
return! execute
| Some ({ timeout=timeout; sla=sla; dryRun = dryRun } as config)->
| Some ({ timeout=timeout; sla=sla; dryRun = dryRun } as cutoffConfig)->
try return! execute
finally
if not jitProcessingInterval.IsValueCreated then
let processingInterval = jitProcessingInterval.Force()
let elapsed = processingInterval.Elapsed
stateLog.Debug("Policy Executed in {elapsedMs} {service:l}-{call:l}", elapsed.TotalMilliseconds, serviceName, callName)
match sla with
| _ when elapsed > timeout && dryRun -> logTimeout callLog config processingInterval
| Some sla when elapsed > sla -> logBreach callLog sla processingInterval
| _ -> () }
if not config.isolate then
match sla with
| _ when elapsed > timeout && dryRun -> logTimeout callLog cutoffConfig processingInterval
| Some sla when elapsed > sla -> logBreach callLog sla processingInterval
| _ -> () }

/// Diagnostic state
member __.InternalState : GovernorState =
Expand Down

0 comments on commit 3fa091e

Please sign in to comment.