This repository was archived by the owner on Jul 8, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
39 lines (35 loc) · 1.38 KB
/
Copy pathProgram.cs
File metadata and controls
39 lines (35 loc) · 1.38 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
37
38
39
namespace StackVis {
using System;
using System.IO;
using System.Linq;
public static class Program {
static void Main(string[] args) {
var sources = new[] {
@"F:\20120515_105712_condensed_mem.txt",
@"F:\20120515_105712_condensed_time.txt",
};
foreach (var source in sources) {
var dest = string.Format(
"{0}_{1}.json",
source,
DateTime.UtcNow.ToString("yyyyMMdd_hhmmss"));
Console.WriteLine("Processing {0}", source);
using (var reader = new StreamReader(source))
using (var writer = new StreamWriter(dest, false)) {
var input = new CollapsedStreamReader(reader, Console.Error);
// De-deupe just in case
//var stacks = input
// .GroupBy(frame => frame.Key)
// .Select((group) => {
// var ret = group.First();
// ret.Count = group.Sum(s => s.Count);
// return ret;
// }).ToList();
new IcicleWriter().Write(writer, input);
}
Console.WriteLine("Wrote {0}", dest);
}
Console.WriteLine("Done!");
}
}
}