コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }