示例#1
0
        public void TestTimeToMainParserLinux()
        {
            string ctfFile = Path.Combine(testAssetDirectory, "test-time-to-main_startup.trace.zip");
            var    parser  = new TimeToMainParser();
            var    pids    = new List <int>()
            {
                24352, 24362, 24371, 24380, 24389
            };
            IEnumerable <Counter> counters = parser.Parse(ctfFile, "emptycsconsoletemplate", pids, "\"pub\\emptycsconsoletemplate.exe\"");
            int count = 0;

            foreach (var counter in counters)
            {
                Assert.True(counter.Results.Count == pids.Count, $"Counter {counter.Name} is expected to have {pids.Count} results.");
                count++;
            }
            Assert.True(count == 1, "Only Time To Main counter should be present.");
        }
示例#2
0
        public void TestTimeToMainParserWindows()
        {
            string etlFile = Path.Combine(testAssetDirectory, "test-time-to-main_startup.etl");
            var    parser  = new TimeToMainParser();
            var    pids    = new List <int>()
            {
                17036, 21640, 12912, 19764, 11624
            };
            IEnumerable <Counter> counters = parser.Parse(etlFile, "emptycsconsoletemplate", pids, "\"pub\\emptycsconsoletemplate.exe\"");
            int count = 0;

            foreach (var counter in counters)
            {
                Assert.True(counter.Results.Count == pids.Count, $"Counter {counter.Name} is expected to have {pids.Count} results.");
                count++;
            }
            Assert.True(count == 2, "Both Time To Main and Time On Thread counter should be present.");
        }