-
-
Notifications
You must be signed in to change notification settings - Fork 236
Expand file tree
/
Copy pathProgram.cs
More file actions
36 lines (31 loc) · 1.03 KB
/
Copy pathProgram.cs
File metadata and controls
36 lines (31 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.IO;
using System.Linq;
using Microsoft.Build.Logging.StructuredLogger;
namespace TimesAndDurations
{
class Program
{
static void Main(string[] args)
{
if (args.Length != 1)
{
return;
}
var logFilePath = args[0];
if (!File.Exists(logFilePath))
{
return;
}
var build = Serialization.Read(logFilePath);
var targets = build
.FindChildrenRecursive<Target>(t => t.StartTime > DateTime.MinValue && t.EndTime < DateTime.MaxValue)
.OrderByDescending(t => t.Duration)
.ToArray();
foreach (var target in targets.Take(10))
{
Console.WriteLine($"Target {target.Name}: {TextUtilities.Display(target.StartTime, displayDate: false)} {TextUtilities.Display(target.EndTime, displayDate: false)} {target.DurationText}");
}
}
}
}