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);
        }
 public void Log(string marker, string counter, string value)
 {
     CmdletLogger.SafeAppendGenericInfo(string.Format("{0}.{1}", marker, counter), value);
 }
 public void Log(string marker, string counter, uint value)
 {
     CmdletLogger.SafeAppendGenericInfo(string.Format("{0}.{1}", marker, counter), value.ToString(NumberFormatInfo.InvariantInfo));
 }
 public void Log(string marker, string counter, TimeSpan value)
 {
     CmdletLogger.SafeAppendGenericInfo(string.Format("{0}.{1}", marker, counter), ((long)value.TotalMilliseconds).ToString(NumberFormatInfo.InvariantInfo));
 }
Esempio n. 5
0
 internal static void SafeSetLogger(Enum key, object value)
 {
     CmdletLogger.SafeSetLogger(Guid.Empty, key, value);
 }
Esempio n. 6
0
 internal static void UpdateLatency(Enum latencyMetadata, double latencyInMilliseconds)
 {
     CmdletLogger.UpdateLatency(Guid.Empty, latencyMetadata, latencyInMilliseconds);
 }
Esempio n. 7
0
 internal static void SafeAppendGenericInfo(string key, string value)
 {
     CmdletLogger.SafeAppendGenericInfo(Guid.Empty, key, value);
 }
Esempio n. 8
0
 internal static void SafeAppendGenericError(string key, string value, bool isUnhandledException)
 {
     CmdletLogger.SafeAppendGenericError(Guid.Empty, key, value, isUnhandledException);
 }
Esempio n. 9
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));
 }
Esempio n. 10
0
 internal static void SafeAppendGenericError(string key, Exception ex, Func <Exception, bool> funcToVerifyException)
 {
     CmdletLogger.SafeAppendGenericError(Guid.Empty, key, ex, funcToVerifyException);
 }
Esempio n. 11
0
 internal static void SafeAppendColumn(Enum column, string key, string value)
 {
     CmdletLogger.SafeAppendColumn(Guid.Empty, column, key, value);
 }