public CounterBenchmarkSetting(string counterName, AssertionType assertionType, Assertion assertion)
 {
     Contract.Requires(!string.IsNullOrEmpty(counterName));
     CounterName   = new CounterMetricName(counterName);
     AssertionType = assertionType;
     Assertion     = assertion;
 }
示例#2
0
 public void BugFix153IsFixed()
 {
     var o = new ActionBenchmarkOutput(benchmarkAction: r =>
     {
         var name = new CounterMetricName(CounterThroughputBenchmark.CounterName);
         var count = r.Data.StatsByMetric[name];
         Assert.True(count.PerSecondStats.Average > 0.0);
     });
     var d = new ReflectionDiscovery(o, DefaultBenchmarkAssertionRunner.Instance, new RunnerSettings());
     var benchmarks = d.FindBenchmarks(typeof(CounterThroughputBenchmark));
     foreach (var b in benchmarks)
     {
         b.Run();
         b.Finish();
         Assert.True(b.AllAssertsPassed);
     }
 }
示例#3
0
 protected bool Equals(CounterMetricName other)
 {
     Contract.Requires(other != null);
     return string.Equals(CounterName, other.CounterName);
 }
 protected bool Equals(CounterMetricName other)
 {
     Contract.Requires(other != null);
     return(string.Equals(CounterName, other.CounterName));
 }