internal static LatencyTracker GetLatencyTracker(Guid cmdletUniqueId) { if (cmdletUniqueId == Guid.Empty && !CmdletThreadStaticData.TryGetCurrentCmdletUniqueId(out cmdletUniqueId)) { return(null); } LatencyTracker result; CmdletStaticDataWithUniqueId <LatencyTracker> .TryGet(cmdletUniqueId, out result); return(result); }
internal static RpsCmdletLoggerBuffer Get(Guid cmdletUniqueId) { if (cmdletUniqueId == Guid.Empty && !CmdletThreadStaticData.TryGetCurrentCmdletUniqueId(out cmdletUniqueId)) { return(null); } RpsCmdletLoggerBuffer rpsCmdletLoggerBuffer; if (!CmdletStaticDataWithUniqueId <RpsCmdletLoggerBuffer> .TryGet(cmdletUniqueId, out rpsCmdletLoggerBuffer)) { rpsCmdletLoggerBuffer = new RpsCmdletLoggerBuffer(); CmdletStaticDataWithUniqueId <RpsCmdletLoggerBuffer> .Set(cmdletUniqueId, rpsCmdletLoggerBuffer); } return(rpsCmdletLoggerBuffer); }