Skip to content

Commit ac82d2c

Browse files
ChristineZh0uChristine Zhou
and
Christine Zhou
authored
Adding "max_memory" to pchecker_summary.txt (#741)
Co-authored-by: Christine Zhou <[email protected]>
1 parent 610b503 commit ac82d2c

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Src/PChecker/CheckerCore/Scheduling/TestingProcessScheduler.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ private void EmitTestReport()
178178
var directory = GlobalTestReport.CheckerConfiguration.OutputDirectory;
179179
var pintPath = directory + file + "_pchecker_summary.txt";
180180
Console.WriteLine($"..... Writing {pintPath}");
181-
File.WriteAllText(pintPath, GlobalTestReport.GetSummaryText($"{Profiler.GetElapsedTime():0.##}"));
181+
File.WriteAllText(pintPath, GlobalTestReport.GetSummaryText(Profiler));
182182

183183
Console.WriteLine($"... Elapsed {Profiler.GetElapsedTime():0.##} sec and used {Profiler.GetMaxMemoryUsage():0.##} GB.");
184184

Src/PChecker/CheckerCore/SystematicTesting/TestReport.cs

+6-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.Runtime.Serialization;
77
using System.Text;
88
using PChecker.Coverage;
9+
using PChecker.Utilities;
910

1011
namespace PChecker.SystematicTesting
1112
{
@@ -181,7 +182,7 @@ public bool Merge(TestReport testReport)
181182
/// <summary>
182183
/// Returns a simple string testing report with only the keys and values.
183184
/// </summary>
184-
public string GetSummaryText(string runtime) {
185+
public string GetSummaryText(Profiler Profiler) {
185186
var report = new StringBuilder();
186187

187188
report.AppendFormat("bugs:{0}", NumOfFoundBugs);
@@ -195,7 +196,10 @@ public string GetSummaryText(string runtime) {
195196
report.AppendFormat("max_depth:{0}", MaxExploredFairSteps < 0 ? 0 : MaxExploredFairSteps);
196197
report.AppendLine();
197198

198-
report.AppendFormat("time_seconds:{0}", runtime);
199+
report.AppendFormat($"time_seconds:{Profiler.GetElapsedTime():0.##}");
200+
report.AppendLine();
201+
202+
report.AppendFormat($"memory_max_mb:{Profiler.GetMaxMemoryUsage():0.##}");
199203

200204
return report.ToString();
201205
}

0 commit comments

Comments
 (0)