internal static void StartLatencyTracker(Guid cmdletUniqueId)
        {
            LatencyTracker latencyTracker = CmdletStaticDataWithUniqueId <LatencyTracker> .Get(cmdletUniqueId);

            if (latencyTracker != null)
            {
                CmdletLogger.SafeAppendGenericError(cmdletUniqueId, "StartLatencyTracker", string.Format("Latency tracker with this cmdlet {0} already exists. Override it anyway.", cmdletUniqueId), false);
            }
            latencyTracker = new LatencyTracker(cmdletUniqueId.ToString(), new Func <IActivityScope>(ActivityContext.GetCurrentActivityScope));
            latencyTracker.Start();
            CmdletStaticDataWithUniqueId <LatencyTracker> .Set(cmdletUniqueId, latencyTracker);
        }
Exemple #2
0
 internal static void SafeAppendGenericError(Guid cmdletUniqueId, string key, Exception ex, Func <Exception, bool> funcToVerifyException)
 {
     CmdletLogger.SafeAppendGenericError(cmdletUniqueId, key, (ex == null) ? null : ex.ToString(), funcToVerifyException(ex));
 }
Exemple #3
0
 internal static void SafeAppendGenericError(string key, string value, bool isUnhandledException)
 {
     CmdletLogger.SafeAppendGenericError(Guid.Empty, key, value, isUnhandledException);
 }
Exemple #4
0
 internal static void SafeAppendGenericError(string key, Exception ex, Func <Exception, bool> funcToVerifyException)
 {
     CmdletLogger.SafeAppendGenericError(Guid.Empty, key, ex, funcToVerifyException);
 }