Exemple #1
0
        public override void Start(string segmentName, bool allowRecursion = false)
        {
            int threadsTotal = 0;

            if (JoinThreadsBeforeSegmentsStart != null && JoinThreadsBeforeSegmentsStart.TryGetValue(segmentName, out threadsTotal))
            {
                WaitStart(segmentName, threadsTotal);
            }
            base.Start(segmentName, allowRecursion);
        }
Exemple #2
0
        public JobProfiler JoinThreadsAroundSegment(string name, int threadCount)
        {
            if (JoinThreadsBeforeSegmentsStart == null)
            {
                JoinThreadsBeforeSegmentsStart = new Dictionary <string, int>(StringComparer.Ordinal);
            }

            JoinThreadsBeforeSegmentsStart.Add(name, threadCount);

            if (JoinThreadsAfterSegmentsEnd == null)
            {
                JoinThreadsAfterSegmentsEnd = new Dictionary <string, int>(StringComparer.Ordinal);
            }

            JoinThreadsAfterSegmentsEnd.Add(name, threadCount);
            return(this);
        }