Ejemplo n.º 1
0
 public HashSet <int> GetMatchNames(string label)
 {
     return(Names.Index().
            Where(p => !NetMsgIds.Contains(p.Key) && p.Value.IndexOf(label, StringComparison.OrdinalIgnoreCase) != -1).
            Select(p => p.Key).
            ToHashSet());
 }
Ejemplo n.º 2
0
        public List <PerfNodeStats> GetStatsForRange(int start, int end)
        {
            var list = new NodeInfo[ppLookup.Count];

            var nodeInframe = new byte[ppLookup.Count];
            var parent      = new ushort[ppLookup.Count];

            for (int j = start; j < end; j++)
            {
                var frame = Frames[j];
                var calls = frame.Calls;

                for (int i = 1; i < calls.Length; i++)
                {
                    int id            = calls[i].ppid;
                    var exclusiveTime = calls[i].ExclusiveTime;

                    nodeInframe[id] = 1;

                    list[id].NodeCount++;
                    list[id].CallCount          += calls[i].CallCount;
                    list[id].TotalTime          += calls[i].Time;
                    list[id].TotalExclusiveTime += exclusiveTime;

                    var nodeAvg = exclusiveTime / (double)calls[i].CallCount;
                    list[id].PeakAvgTime   = Math.Max(nodeAvg, nodeAvg);
                    list[id].PeakFrameTime = Math.Max(calls[i].ExclusiveTime, list[id].PeakFrameTime);
                }

                for (int i = 0; i < ppLookup.Count; i++)
                {
                    list[i].FrameCount += nodeInframe[i];
                    nodeInframe[i]      = 0;
                }
            }

            var nodeStats = new List <PerfNodeStats>(ppLookup.Count - NetMsgIds.Count);

            Debug.Assert(Threadppid == 1);
            //Skip the shared Frame Thread node
            for (int i = 0; i < ppLookup.Count; i++)
            {
                var name = ppMap[i];

                if (NetMsgIds.Contains(i))
                {
                    continue;
                }

                var node = new PerfNodeStats(this, name, i);
                node.SetStats(list[i]);
                nodeStats.Add(node);
            }

            return(nodeStats);
        }