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)); }
internal static void SafeSetLogger(Enum key, object value) { CmdletLogger.SafeSetLogger(Guid.Empty, key, value); }
internal static void UpdateLatency(Enum latencyMetadata, double latencyInMilliseconds) { CmdletLogger.UpdateLatency(Guid.Empty, latencyMetadata, latencyInMilliseconds); }
internal static void SafeAppendGenericInfo(string key, string value) { CmdletLogger.SafeAppendGenericInfo(Guid.Empty, key, value); }
internal static void SafeAppendGenericError(string key, string value, bool isUnhandledException) { CmdletLogger.SafeAppendGenericError(Guid.Empty, key, value, isUnhandledException); }
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)); }
internal static void SafeAppendGenericError(string key, Exception ex, Func <Exception, bool> funcToVerifyException) { CmdletLogger.SafeAppendGenericError(Guid.Empty, key, ex, funcToVerifyException); }
internal static void SafeAppendColumn(Enum column, string key, string value) { CmdletLogger.SafeAppendColumn(Guid.Empty, column, key, value); }