Skip to content

Commit

Permalink
Adding "max_memory" to pchecker_summary.txt (#741)
Browse files Browse the repository at this point in the history
Co-authored-by: Christine Zhou <[email protected]>
  • Loading branch information
ChristineZh0u and Christine Zhou authored May 30, 2024
1 parent 610b503 commit ac82d2c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ private void EmitTestReport()
var directory = GlobalTestReport.CheckerConfiguration.OutputDirectory;
var pintPath = directory + file + "_pchecker_summary.txt";
Console.WriteLine($"..... Writing {pintPath}");
File.WriteAllText(pintPath, GlobalTestReport.GetSummaryText($"{Profiler.GetElapsedTime():0.##}"));
File.WriteAllText(pintPath, GlobalTestReport.GetSummaryText(Profiler));

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

Expand Down
8 changes: 6 additions & 2 deletions Src/PChecker/CheckerCore/SystematicTesting/TestReport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Runtime.Serialization;
using System.Text;
using PChecker.Coverage;
using PChecker.Utilities;

namespace PChecker.SystematicTesting
{
Expand Down Expand Up @@ -181,7 +182,7 @@ public bool Merge(TestReport testReport)
/// <summary>
/// Returns a simple string testing report with only the keys and values.
/// </summary>
public string GetSummaryText(string runtime) {
public string GetSummaryText(Profiler Profiler) {
var report = new StringBuilder();

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

report.AppendFormat("time_seconds:{0}", runtime);
report.AppendFormat($"time_seconds:{Profiler.GetElapsedTime():0.##}");
report.AppendLine();

report.AppendFormat($"memory_max_mb:{Profiler.GetMaxMemoryUsage():0.##}");

return report.ToString();
}
Expand Down

0 comments on commit ac82d2c

Please sign in to comment.