/// <summary>
        /// Returns a structure containing platform information extracted from the log
        /// </summary>
        /// <returns></returns>
        public PlatformInfo GetPlatformInfo()
        {
            var Info = new PlatformInfo();

            var InfoRegEx = @"LogInit.+OS:\s*(.+?)\s*(\((.+)\))?,\s*CPU:\s*(.+)\s*,\s*GPU:\s*(.+)";

            RegexUtil.MatchAndApplyGroups(Content, InfoRegEx, (Groups) =>
            {
                Info.OSName    = Groups[1];
                Info.OSVersion = Groups[3];
                Info.CPUName   = Groups[4];
                Info.GPUName   = Groups[5];
            });

            return(Info);
        }
Exemplo n.º 2
0
        public virtual void CreateFromString(string InContent)
        {
            RegexUtil.MatchAndApplyGroups(InContent, @".+Snapshot:\s+(.+?)\s+=", (Groups) =>
            {
                Name = Groups[1];
            });

            RegexUtil.MatchAndApplyGroups(InContent, @"CPU Memory:[\s\w]+?([\d\.]+)MB,[\s\w]+?([\d\.]+)MB", (Groups) =>
            {
                CpuUsedMemory += Convert.ToSingle(Groups[1]);
                CpuPeakMemory += Convert.ToSingle(Groups[2]);
            });

            RegexUtil.MatchAndApplyGroups(InContent, @"Physical Memory:[\s\w]+?([\d\.]+)MB,[\s\w:]+?([\d\.]+)MB", (Groups) =>
            {
                PhysicalUsedMemory += Convert.ToSingle(Groups[1]);
                PhysicalPeakMemory += Convert.ToSingle(Groups[2]);
            });

            RegexUtil.MatchAndApplyGroups(InContent, @"MeasuredPerfTime:\s(\d.+) S", (Groups) =>
            {
                ProfileLength += Convert.ToSingle(Groups[1]);
            });

            RegexUtil.MatchAndApplyGroups(InContent, @"MVP:\s(\d.+)%,\s.*AvgFPS:(\d.+),\s.*HitchesPerMinute:\s(\d.+),\sAvg\sHitch\s(\d.+)ms", (Groups) =>
            {
                MVP        = Convert.ToSingle(Groups[1]);
                AvgFps     = Convert.ToSingle(Groups[2]);
                Hitches    = Convert.ToSingle(Groups[3]);
                AvgHitches = Convert.ToSingle(Groups[4]);
            });

            RegexUtil.MatchAndApplyGroups(InContent, @"GT:.* Avg\s(\d.+)ms,", (Groups) =>
            {
                GTTime = Convert.ToSingle(Groups[1]);
            });

            RegexUtil.MatchAndApplyGroups(InContent, @"RT:.* Avg\s(\d.+)ms,", (Groups) =>
            {
                RTTime = Convert.ToSingle(Groups[1]);
            });

            RegexUtil.MatchAndApplyGroups(InContent, @"GPU:.* Avg\s(\d.+)ms,", (Groups) =>
            {
                GPUTime = Convert.ToSingle(Groups[1]);
            });

            RegexUtil.MatchAndApplyGroups(InContent, @"FT:.* Avg:\s([\d\.]+)ms,", (Groups) =>
            {
                FTTime = Convert.ToSingle(Groups[1]);
            });

            RegexUtil.MatchAndApplyGroups(InContent, @"RHIT:.* Avg\s([\d\.]+)ms,", (Groups) =>
            {
                RHIT = Convert.ToSingle(Groups[1]);
            });

            RegexUtil.MatchAndApplyGroups(InContent, @"DynRes:.* Avg:\s([\d\.]+)%,", (Groups) =>
            {
                DynamicRes = Convert.ToSingle(Groups[1]);
            });

            RegexUtil.MatchAndApplyGroups(InContent, @"DrawCalls:[\w\s:]+?([\d\.]+),[\w\s:]+?([\d\.]+),[\w\s:]+?([\d\.]+)", (Groups) =>
            {
                DrawCalls = Convert.ToInt32(Groups[1]);
            });

            RegexUtil.MatchAndApplyGroups(InContent, @"DrawnPrims:[\w\s:]+?([\d\.]+),[\w\s:]+?([\d\.]+),[\w\s:]+?([\d\.]+)", (Groups) =>
            {
                DrawnPrims = Convert.ToInt32(Groups[1]);
            });
            RegexUtil.MatchAndApplyGroups(InContent, @"UnbuiltHLODs:\s(\d.+)", (Groups) =>
            {
                UnbuiltHLODs = Convert.ToInt32(Groups[1]);
            });
        }