示例#1
0
        public void AddFrameRecords <FrameAggregate>(IFrameDebugProvider provider, IEnumerable <IFrameRecord> records) where FrameAggregate : IFrameAggregate, new()
        {
            if (!m_RecordingEnabled)
            {
                return;
            }

            AddFrameDebugProvider(provider);

            FrameAggregateSet aggregates;
            int providerIdentifier = provider.GetUniqueIdentifier();

            if (!m_FrameAggregates.TryGetValue(providerIdentifier, out aggregates))
            {
                aggregates = FrameAggregateSet.Create();
                m_FrameAggregates.Add(providerIdentifier, aggregates);
            }

            Type aggregateType = typeof(FrameAggregate);
            FrameAggregateInfo aggregateInfo;

            if (!aggregates.aggregates.TryGetValue(aggregateType, out aggregateInfo))
            {
                aggregateInfo = FrameAggregateInfo.Create <FrameAggregate>();
                aggregates.aggregates.Add(aggregateType, aggregateInfo);
            }

            aggregateInfo.pendingRecords.AddRange(records);
        }
示例#2
0
 public void ClearPendingRecords()
 {
     foreach (var pair in aggregates.ToList())
     {
         FrameAggregateInfo aggregateInfo = pair.Value;
         aggregateInfo.ClearPendingRecords();
         aggregates[pair.Key] = aggregateInfo;
     }
 }
示例#3
0
            public void PruneRecordsStartingAfterTimeStamp(float startTimeInSeconds)
            {
                List <Type> emptyAggregateTypes = new List <Type>(aggregates.Count);

                foreach (var pair in aggregates)
                {
                    FrameAggregateInfo aggregateInfo = pair.Value;

                    aggregateInfo.PruneRecordsStartingAfterTimeStamp(startTimeInSeconds);

                    if (aggregateInfo.aggregate.IsEmpty)
                    {
                        emptyAggregateTypes.Add(pair.Key);
                    }
                }

                foreach (Type type in emptyAggregateTypes)
                {
                    aggregates.Remove(type);
                }
            }
示例#4
0
            public void UpdateRecords(float frameStartTime, float frameEndTime, float startTimeInSeconds)
            {
                List <Type> emptyAggregateTypes = new List <Type>(aggregates.Count);

                foreach (var pair in aggregates)
                {
                    FrameAggregateInfo aggregateInfo = pair.Value;

                    aggregateInfo.UpdateRecords(frameStartTime, frameEndTime, startTimeInSeconds);

                    if (aggregateInfo.aggregate.IsEmpty)
                    {
                        emptyAggregateTypes.Add(pair.Key);
                    }
                }

                foreach (Type type in emptyAggregateTypes)
                {
                    aggregates.Remove(type);
                }
            }