Exemplo n.º 1
0
 public CounterBenchmarkSetting(string counterName, AssertionType assertionType, Assertion assertion)
 {
     Contract.Requires(!string.IsNullOrEmpty(counterName));
     CounterName   = new CounterMetricName(counterName);
     AssertionType = assertionType;
     Assertion     = assertion;
 }
Exemplo n.º 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);
            }
        }
Exemplo n.º 3
0
 internal Counter(AtomicCounter internalCounter, CounterMetricName name)
 {
     _internalCounter = internalCounter;
     Name = name;
 }
Exemplo n.º 4
0
 internal Counter(AtomicCounter internalCounter, CounterMetricName name)
 {
     _internalCounter = internalCounter;
     Name             = name;
 }