From 3fa091e47b085d87240afefdb5dceeb23dfbf928 Mon Sep 17 00:00:00 2001 From: Ruben Bartelink Date: Thu, 25 Oct 2018 16:26:24 +0100 Subject: [PATCH] Inhibit slow logging when isolated --- src/CallPolly/Rules.fs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/CallPolly/Rules.fs b/src/CallPolly/Rules.fs index 5346b42..927c8e0 100644 --- a/src/CallPolly/Rules.fs +++ b/src/CallPolly/Rules.fs @@ -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 =