summaryrefslogtreecommitdiff
path: root/Source/ExecutionEngine/VerificationResultCache.cs
diff options
context:
space:
mode:
authorGravatar wuestholz <unknown>2014-07-04 05:15:38 +0200
committerGravatar wuestholz <unknown>2014-07-04 05:15:38 +0200
commit454f7ff730ca2b17e6b9c705d36f071d66d9ef45 (patch)
tree445f676dbdd4c94d12ed38c10893e36212b74a48 /Source/ExecutionEngine/VerificationResultCache.cs
parent06aadffd71f2d96070703371c62bd0e14c76b91f (diff)
Made it collect more statistics about the more advanced verification result caching.
Diffstat (limited to 'Source/ExecutionEngine/VerificationResultCache.cs')
-rw-r--r--Source/ExecutionEngine/VerificationResultCache.cs60
1 files changed, 40 insertions, 20 deletions
diff --git a/Source/ExecutionEngine/VerificationResultCache.cs b/Source/ExecutionEngine/VerificationResultCache.cs
index 5c3324cc..58423f24 100644
--- a/Source/ExecutionEngine/VerificationResultCache.cs
+++ b/Source/ExecutionEngine/VerificationResultCache.cs
@@ -18,6 +18,10 @@ namespace Microsoft.Boogie
public DateTime End { get; internal set; }
public int RewrittenImplementationCount { get; internal set; }
public int ImplementationCount { get; internal set; }
+ public int SkippedImplementationCount { get; set; }
+ public int LowPriorityImplementationCount { get; set; }
+ public int MediumPriorityImplementationCount { get; set; }
+ public int HighPriorityImplementationCount { get; set; }
}
@@ -37,21 +41,21 @@ namespace Microsoft.Boogie
wr.WriteLine("Cached verification result injector statistics as CSV:");
if (printTime)
{
- wr.WriteLine("Request ID, Time (ms), Rewritten Implementations, Implementations");
+ wr.WriteLine("Request ID, Time (ms), Rewritten Implementations, Low Priority Implementations, Medium Priority Implementations, High Priority Implementations, Skipped Implementations, Implementations");
}
else
{
- wr.WriteLine("Request ID, Rewritten Implementations, Implementations");
+ wr.WriteLine("Request ID, Rewritten Implementations, Low Priority Implementations, Medium Priority Implementations, High Priority Implementations, Skipped Implementations, Implementations");
}
foreach (var kv in runs)
{
if (printTime)
{
- wr.WriteLine("{0}, {1}, {2}, {3}", kv.Key, kv.Value.End.Subtract(kv.Value.Start).TotalMilliseconds, kv.Value.RewrittenImplementationCount, kv.Value.ImplementationCount);
+ wr.WriteLine("{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}", kv.Key, kv.Value.End.Subtract(kv.Value.Start).TotalMilliseconds, kv.Value.RewrittenImplementationCount, kv.Value.LowPriorityImplementationCount, kv.Value.MediumPriorityImplementationCount, kv.Value.HighPriorityImplementationCount, kv.Value.SkippedImplementationCount, kv.Value.ImplementationCount);
}
else
{
- wr.WriteLine("{0}, {1}, {2}", kv.Key, kv.Value.RewrittenImplementationCount, kv.Value.ImplementationCount);
+ wr.WriteLine("{0}, {1}, {2}, {3}, {4}, {5}, {6}", kv.Key, kv.Value.RewrittenImplementationCount, kv.Value.LowPriorityImplementationCount, kv.Value.MediumPriorityImplementationCount, kv.Value.HighPriorityImplementationCount, kv.Value.SkippedImplementationCount, kv.Value.ImplementationCount);
}
}
return wr.ToString();
@@ -117,28 +121,44 @@ namespace Microsoft.Boogie
{
int priority;
var vr = ExecutionEngine.Cache.Lookup(impl, out priority);
- if (vr != null && priority == Priority.LOW)
+ if (vr != null)
{
- if (TimeThreshold < vr.End.Subtract(vr.Start).TotalMilliseconds)
+ if (priority == Priority.LOW)
{
- if (vr.Errors != null)
+ run.LowPriorityImplementationCount++;
+ if (TimeThreshold < vr.End.Subtract(vr.Start).TotalMilliseconds)
{
- impl.ErrorsInCachedSnapshot = vr.Errors.ToList<object>();
- }
- else if (vr.Outcome == ConditionGeneration.Outcome.Correct)
- {
- impl.ErrorsInCachedSnapshot = new List<object>();
- }
- if (vr.ProgramId != null)
- {
- var p = ExecutionEngine.CachedProgram(vr.ProgramId);
- if (p != null)
+ if (vr.Errors != null)
+ {
+ impl.ErrorsInCachedSnapshot = vr.Errors.ToList<object>();
+ }
+ else if (vr.Outcome == ConditionGeneration.Outcome.Correct)
+ {
+ impl.ErrorsInCachedSnapshot = new List<object>();
+ }
+ if (vr.ProgramId != null)
{
- eai.Inject(impl, p);
- run.RewrittenImplementationCount++;
+ var p = ExecutionEngine.CachedProgram(vr.ProgramId);
+ if (p != null)
+ {
+ eai.Inject(impl, p);
+ run.RewrittenImplementationCount++;
+ }
}
}
}
+ else if (priority == Priority.MEDIUM)
+ {
+ run.MediumPriorityImplementationCount++;
+ }
+ else if (priority == Priority.HIGH)
+ {
+ run.HighPriorityImplementationCount++;
+ }
+ else if (priority == Priority.SKIP)
+ {
+ run.SkippedImplementationCount++;
+ }
}
}
run.End = DateTime.UtcNow;
@@ -403,7 +423,7 @@ namespace Microsoft.Boogie
public class VerificationResultCache
{
private readonly MemoryCache Cache = new MemoryCache("VerificationResultCache");
- private readonly CacheItemPolicy Policy = new CacheItemPolicy { SlidingExpiration = new TimeSpan(0, 10, 0) };
+ private readonly CacheItemPolicy Policy = new CacheItemPolicy { SlidingExpiration = new TimeSpan(0, 10, 0), Priority = CacheItemPriority.Default };
public void Insert(Implementation impl, VerificationResult result)