-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathResult.cs
65 lines (54 loc) · 2.01 KB
/
Result.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using System.Diagnostics;
namespace Genometric.MSPC.Benchmark
{
public class Result
{
private const string _delimiter = "\t";
public string Version { set; get; } = "not_specified";
public string ExperimentId { set; get; } = "not_specified";
public int ReplicateCount { set; get; }
public int IntervalCount { set; get; }
/// <summary>
/// Gets and sets the maximum amount of physical memory used, in byte.
/// </summary>
public long PeakPhysicalMemoryUsage { set; get; }
/// <summary>
/// The maximum amount of virtual memory, in bytes, allocated for the process.
/// </summary>
public long PeakPagedMemoryUsage { set; get; }
/// <summary>
/// Gets and sets the maximum amount of memory, in bytes,
/// allocated in the virtual memory paging file for the process.
/// </summary>
public long PeakVirtualMemoryUsage { set; get; }
public Stopwatch Runtime { get; } = new();
public static string GetHeader(string delimiter = _delimiter)
{
return string.Join(delimiter, new string[]
{
"mspc_version",
"experiment_id",
"replicate_count",
"interval_count",
"runtime_seconds",
"peak_physical_memory_usage_bytes",
"peak_paged_memory_usage_bytes",
"peak_virtual_memory_usage_bytes"
});
}
public string ToString(string delimiter = _delimiter)
{
return string.Join(delimiter, new string[]
{
Version,
ExperimentId,
ReplicateCount.ToString(),
IntervalCount.ToString(),
Runtime.Elapsed.TotalSeconds.ToString(),
PeakPhysicalMemoryUsage.ToString(),
PeakPagedMemoryUsage.ToString(),
PeakVirtualMemoryUsage.ToString()
});
}
}
}