-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathProgram.cs
41 lines (36 loc) · 1.39 KB
/
Program.cs
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
40
41
using Genometric.MSPC.Benchmark.CLI;
namespace Genometric.MSPC.Benchmark
{
static class Program
{
public static async Task<int> Main(string[] args)
{
var cli = new CommandLineInterface(Handler);
return await cli.InvokeAsync(args);
}
public static async Task Handler(string[] releases, DirectoryInfo dataDir, int maxRepCount)
{
if (!dataDir.Exists)
throw new DirectoryNotFoundException($"{dataDir.FullName} does not exist.");
var resultsFilename = Path.Join(
dataDir.FullName,
$"mspc_versions_benchmarking_results_" +
$"{new DateTimeOffset(DateTime.UtcNow).ToUnixTimeSeconds()}.tsv");
using (var writer = new StreamWriter(resultsFilename))
writer.WriteLine(Result.GetHeader());
Console.WriteLine($"Results are writen in file `{resultsFilename}`.");
foreach (var release in releases)
{
try
{
Console.WriteLine($"Benchmarking version {release}:");
PerformanceTest.Test(dataDir.FullName, resultsFilename, release, maxRepCount);
}
catch (Exception e)
{
Console.Write($"{e.Message}\tSkipping this version.");
}
}
}
}
}