Example #1
0
        public void TestProcessTimeParserWindows()
        {
            string etlFile = Path.Combine(testAssetDirectory, "test-process-time_startup.etl");
            var    parser  = new ProcessTimeParser();
            var    pids    = new List <int>()
            {
                32752, 6352, 16876, 10500, 17784
            };
            IEnumerable <Counter> counters = parser.Parse(etlFile, "dotnet", pids, "\"dotnet\" build");
            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 Process Time and Time On Thread counter should be present.");
        }
Example #2
0
        public void TestProcessTimeParserLinux()
        {
            string ctfFile = Path.Combine(testAssetDirectory, "test-process-time_startup.trace.zip");
            var    parser  = new ProcessTimeParser();
            var    pids    = new List <int>()
            {
                18627, 18674, 18721, 18768, 18813
            };
            IEnumerable <Counter> counters = parser.Parse(ctfFile, "dotnet", pids, "\"dotnet\" build");
            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 Process Time counter should be present.");
        }