Пример #1
0
        /// <summary> Exports this snapshots internal properties into a human readable format. </summary>
        public override string ToString()
        {
            StringBuilder StrBuilder = new StringBuilder(1024);

            ///// <summary> User defined description of time of snapshot. </summary>
            //public string Description;
            StrBuilder.AppendLine("Description: " + Description);

            ///// <summary> List of callstack allocations. </summary>
            //public List<FCallStackAllocationInfo> ActiveCallStackList;

            ///// <summary> List of lifetime callstack allocations for memory churn. </summary>
            //public List<FCallStackAllocationInfo> LifetimeCallStackList;

            ///// <summary> Position in the stream. </summary>
            //public ulong StreamIndex;

            StrBuilder.AppendLine("Stream Index: " + StreamIndex);

            ///// <summary> Frame number. </summary>
            //public int FrameNumber;
            StrBuilder.AppendLine("Frame Number: " + FrameNumber);

            ///// <summary> Current time. </summary>
            //public float CurrentTime;
            StrBuilder.AppendLine("Current Time: " + CurrentTime + " seconds");

            ///// <summary> Current time starting from the previous snapshot marker. </summary>
            //public float ElapsedTime;
            StrBuilder.AppendLine("Elapsed Time: " + ElapsedTime + " seconds");

            ///// <summary> Snapshot type. </summary>
            //public EProfilingPayloadSubType SubType = EProfilingPayloadSubType.SUBTYPE_SnapshotMarker;
            StrBuilder.AppendLine("Snapshot Type: " + SubType.ToString());

            ///// <summary> Index of snapshot. </summary>
            //public int SnapshotIndex;
            StrBuilder.AppendLine("Snapshot Index: " + SnapshotIndex);

            ///// <summary> Platform dependent memory metrics. </summary>
            //public List<long> Metrics;
            StrBuilder.AppendLine("Metrics: ");
            if (MetricArray.Count > 0)
            {
                if (FStreamToken.Version >= 4)
                {
                    // Just ignore
                }
                else if (FStreamToken.Version > 2 && MetricArray.Count == (int)ESnapshotMetricV3.Count)
                {
                    string[] MetricNames = Enum.GetNames(typeof(ESnapshotMetricV3));
                    for (int MetricIndex = 0; MetricIndex < MetricNames.Length - 1; MetricIndex++)
                    {
                        string MetricName = MetricNames[MetricIndex];
                        long   MetricData = MetricArray[MetricIndex];
                        if (MetricData != 0)
                        {
                            string MetricValue = (MetricName == "TotalUsedChunks") ? MetricData.ToString() : MainWindow.FormatSizeString2(MetricData);
                            string Metric      = "	"+ MetricName + ": " + MetricValue;
                            StrBuilder.AppendLine(Metric);
                        }
                    }
                }
            }

            ///// <summary> Array of names of all currently loaded levels formated for usage in details view tab. </summary>
            //public List<string> LoadedLevelNames = new List<string>();
            StrBuilder.AppendLine("Loaded Levels: " + LoadedLevels.Count);
            foreach (string LevelName  in LoadedLevelNames)
            {
                StrBuilder.AppendLine("	" + LevelName);
            }

            ///// <summary> Generic memory allocation stats. </summary>
            //public FMemoryAllocationStats MemoryAllocationStats = new FMemoryAllocationStats();

            if (FStreamToken.Version >= 4)
            {
                StrBuilder.AppendLine("Memory Allocation Stats: ");
                StrBuilder.Append(MemoryAllocationStats4.ToString());
            }
            else
            {
                StrBuilder.AppendLine("Memory Allocation Stats: ");
                StrBuilder.Append(MemoryAllocationStats3.ToString());
            }

            ///// <summary> Running count of number of allocations. </summary>
            //public long AllocationCount = 0;
            StrBuilder.AppendLine("Allocation Count: " + AllocationCount);

            ///// <summary> Running total of size of allocations. </summary>
            //public long AllocationSize = 0;
            StrBuilder.AppendLine("Allocation Size: " + MainWindow.FormatSizeString2(AllocationSize));

            ///// <summary> Running total of size of allocations. </summary>
            //public long AllocationMaxSize = 0;
            StrBuilder.AppendLine("Allocation Max Size: " + MainWindow.FormatSizeString2(AllocationMaxSize));

            ///// <summary> True if this snapshot was created as a diff of two snapshots. </summary>
            //public bool bIsDiffResult;
            StrBuilder.AppendLine("Is Diff Result: " + bIsDiffResult);

            ///// <summary> Running total of allocated memory. </summary>
            //public List<FMemorySlice> OverallMemorySlice;
            //StrBuilder.AppendLine( "Overall Memory Slice: @TODO"  );

            return(StrBuilder.ToString());
        }
Пример #2
0
        /// <summary> Exports this snapshots internal properties into a human readable format. </summary>
        public override string ToString()
        {
            StringBuilder StrBuilder = new StringBuilder(1024);

            ///// <summary> User defined description of time of snapshot. </summary>
            //public string Description;
            StrBuilder.AppendLine("Description: " + Description);

            ///// <summary> List of callstack allocations. </summary>
            //public List<FCallStackAllocationInfo> ActiveCallStackList;

            ///// <summary> List of lifetime callstack allocations for memory churn. </summary>
            //public List<FCallStackAllocationInfo> LifetimeCallStackList;

            ///// <summary> Position in the stream. </summary>
            //public ulong StreamIndex;

            StrBuilder.AppendLine("Stream Index: " + StreamIndex);

            ///// <summary> Frame number. </summary>
            //public int FrameNumber;
            StrBuilder.AppendLine("Frame Number: " + FrameNumber);

            ///// <summary> Current time. </summary>
            //public float CurrentTime;
            StrBuilder.AppendLine("Current Time: " + CurrentTime + " seconds");

            ///// <summary> Current time starting from the previous snapshot marker. </summary>
            //public float ElapsedTime;
            StrBuilder.AppendLine("Elapsed Time: " + ElapsedTime + " seconds");

            ///// <summary> Snapshot type. </summary>
            //public EProfilingPayloadSubType SubType = EProfilingPayloadSubType.SUBTYPE_SnapshotMarker;
            StrBuilder.AppendLine("Snapshot Type: " + SubType.ToString());

            ///// <summary> Index of snapshot. </summary>
            //public int SnapshotIndex;
            StrBuilder.AppendLine("Snapshot Index: " + SnapshotIndex);

            ///// <summary> Array of names of all currently loaded levels formated for usage in details view tab. </summary>
            //public List<string> LoadedLevelNames = new List<string>();
            StrBuilder.AppendLine("Loaded Levels: " + LoadedLevels.Count);
            foreach (string LevelName  in LoadedLevelNames)
            {
                StrBuilder.AppendLine("	" + LevelName);
            }

            ///// <summary> Generic memory allocation stats. </summary>
            //public FMemoryAllocationStats MemoryAllocationStats = new FMemoryAllocationStats();

            StrBuilder.AppendLine("Memory Allocation Stats: ");
            StrBuilder.Append(MemoryAllocationStats4.ToString());

            ///// <summary> Running count of number of allocations. </summary>
            //public long AllocationCount = 0;
            StrBuilder.AppendLine("Allocation Count: " + AllocationCount.ToString("N0"));

            ///// <summary> Running total of size of allocations. </summary>
            //public long AllocationSize = 0;
            StrBuilder.AppendLine("Allocation Size: " + MainWindow.FormatSizeString2(AllocationSize));

            ///// <summary> Running total of size of allocations. </summary>
            //public long AllocationMaxSize = 0;
            StrBuilder.AppendLine("Allocation Max Size: " + MainWindow.FormatSizeString2(AllocationMaxSize));

            ///// <summary> True if this snapshot was created as a diff of two snapshots. </summary>
            //public bool bIsDiffResult;
            StrBuilder.AppendLine("Is Diff Result: " + bIsDiffResult);

            ///// <summary> Running total of allocated memory. </summary>
            //public List<FMemorySlice> OverallMemorySlice;
            //StrBuilder.AppendLine( "Overall Memory Slice: @TODO"  );

            return(StrBuilder.ToString());
        }