Skip to content

Commit

Permalink
Added pint.txt file that contains telemetries needed for Pint
Browse files Browse the repository at this point in the history
  • Loading branch information
Christine Zhou committed May 28, 2024
1 parent c24802d commit 7b3f731
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using PChecker.SystematicTesting;
using PChecker.Testing;
using PChecker.Utilities;
Expand Down Expand Up @@ -172,6 +173,13 @@ private void EmitTestReport()
}

Console.WriteLine(GlobalTestReport.GetText(_checkerConfiguration, "..."));

var file = Path.GetFileNameWithoutExtension(GlobalTestReport.CheckerConfiguration.AssemblyToBeAnalyzed);
var directory = GlobalTestReport.CheckerConfiguration.OutputDirectory;
var pintPath = directory + file + ".pchecker.summary.txt";
Console.WriteLine($"..... Writing {pintPath}");
File.WriteAllText(pintPath, GlobalTestReport.GetSimpleText($"{Profiler.GetElapsedTime():0.##}"));

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

if (GlobalTestReport.InternalErrors.Count > 0)
Expand Down
22 changes: 22 additions & 0 deletions Src/PChecker/CheckerCore/SystematicTesting/TestReport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,28 @@ public bool Merge(TestReport testReport)
return true;
}

/// <summary>
/// Returns a simple string testing report with only the keys and values.
/// </summary>
public string GetSimpleText(string runtime) {
var report = new StringBuilder();

report.AppendFormat("bugs:{0}", NumOfFoundBugs);
report.AppendLine();

var totalExploredSchedules = NumOfExploredFairSchedules +
NumOfExploredUnfairSchedules;
report.AppendFormat("schedules:{0}", totalExploredSchedules);
report.AppendLine();

report.AppendFormat("max_depth:{0}", MaxExploredFairSteps < 0 ? 0 : MaxExploredFairSteps);
report.AppendLine();

report.AppendFormat("time_seconds:{0}", runtime);

return report.ToString();
}

/// <summary>
/// Returns the testing report as a string, given a checkerConfiguration and an optional prefix.
/// </summary>
Expand Down

0 comments on commit 7b3f731

Please sign in to comment.