public void ForLoop(BenchmarkContext context)
 {
     for (var i = EsimatedOperationsPerSecond; i != 0; i--)
     {
         _counter.Increment();
     }
 }
示例#2
0
        public void SetUp(BenchmarkContext context)
        {
            _counter = context.GetCounter(CounterName);

            if (ConfigurationManager.AppSettings["TestKey"] != "42")
                throw new InvalidOperationException("TestKey from AppSettings could not be loaded!");
        }
 public void BenchmarkTestMethod(BenchmarkContext context)
 {
     _counter.Increment();
     {
         var bytes = new byte[1 << 13];
         bytes = null;
     }
 }
示例#4
0
 public BenchmarkRun(IReadOnlyList<MeasureBucket> measures, IReadOnlyList<Counter> counters)
 {
     Contract.Requires(measures != null);
     Contract.Requires(counters != null);
     Measures = measures;
     MeasureCount = measures.Count;
     Counters = counters.ToDictionary(key => key.Name, v => v);
     Context = new BenchmarkContext(Counters);
 }
        public void InvokePerfSetup(BenchmarkContext context)
        {
            _testClassInstance = Activator.CreateInstance(_metadata.BenchmarkClass);
            _cleanupAction = Compile(_metadata.Cleanup);
            _setupAction = Compile(_metadata.Setup);
            _runAction = Compile(_metadata.Run);

            _setupAction(context);
        }
 public void BenchmarkTestMethod(BenchmarkContext context)
 {
     _counter.Increment();
     {
         var bytes = new byte[1 << 13];
         bytes = null;
     }
     Thread.Sleep(IterationSpeedMs);
 }
        public void SaveSummary(BenchmarkRunSummary summary)
        {
            using (var db = new BenchmarkContext(_connectionString))
            {
                db.Database.EnsureCreated();

                db.RunSummaries.Add(summary);
                db.SaveChanges();
            }
        }
 public void Control(BenchmarkContext context)
 {
     var runCount = EsimatedOperationsPerSecond;
     while (true)
     {
         _counter.Increment();
         if (runCount-- == 0)
             break;
     }
 }
 public void InvokePerfSetup(long runCount, BenchmarkContext context)
 {
     _actualRunAction = benchmarkContext =>
     {
         for (var i = runCount; i != 0;)
         {
             _runAction(context);
             --i;
         }
     };
     InvokePerfSetup(context);
 }
        public void ForLoopNested(BenchmarkContext context)
        {

            for (var j = OuterOperations; j != 0; j--)
            {
                for (var i = InnerOperation; i != 0;)
                {
                    _counter.Increment();
                    --i;
                }
            }
        }
        public void InvokePerfCleanup(BenchmarkContext context)
        {
            // cleanup method
            _cleanupAction(context);

            // instance cleanup
            var disposable = _testClassInstance as IDisposable;
            disposable?.Dispose();

            _testClassInstance = null;
            _setupAction = null;
            _cleanupAction = null;
            _runAction = null;
        }
        public void InvokePerfSetup(long runCount, BenchmarkContext context)
        {
            InvokePerfSetup(context);

            var previousRunAction = _runAction;

            _runAction = ctx =>
            {
                for (long i = runCount; i != 0;)
                {
                    previousRunAction(ctx);
                    --i;
                }
            };
        }
示例#13
0
 public void Cleanup(BenchmarkContext context)
 {
     context.Trace.Info(CleanupTrace);
 }
 public void Setup(BenchmarkContext benchContext)
 {
     addCounter = benchContext.GetCounter(AddCounterName);
     // key = 0;
 }
示例#15
0
 public void ParseLocalThroughput(BenchmarkContext context)
 {
     Address.Parse("akka.tcp://sys@localhost:9091");
     _parseThroughput.Increment();
 }
 public void Cleanup(BenchmarkContext context)
 {
     ReflectionBenchmarkInvokerSpecs.CleanupContextSet = context != null;
 }
 public void Setup(BenchmarkContext context)
 {
     Task.Run(RealWorkMethod).Wait();
     ReflectionBenchmarkInvokerSpecs.SetupContextSet = context != null;
 }
示例#18
0
 public WorkItemsController(BenchmarkContext benchmarkContext)
 {
     _benchmarkContext = benchmarkContext;
 }
示例#19
0
 public void Cleanup(BenchmarkContext context)
 {
     //does nothing
 }
示例#20
0
 public void Setup(BenchmarkContext context)
 {
     addCounter = context.GetCounter(SumCounterName);
 }
示例#21
0
 public void DispatchThroughput(BenchmarkContext context)
 {
     _dispatcher.Dispatch(_targetActorRef, _systemAddress, _message);
 }
 public void StressTestStandardOutWriter(BenchmarkContext context)
 {
     StandardOutWriter.WriteLine(InputStr, ConsoleColor.Black, ConsoleColor.DarkGreen);
     _consoleWriteThroughputCounter.Increment();
 }
 public void SetUp(BenchmarkContext context)
 {
     // disable SO so we don't fill up the build log with garbage
     Console.SetOut(new StreamWriter(Stream.Null));
     _consoleWriteThroughputCounter = context.GetCounter(ConsoleWriteThroughputCounterName);
 }
示例#24
0
 public void Setup(BenchmarkContext context)
 {
     _system = ActorSystem.Create($"ActorMemoryFootprintSpec{Counter.GetAndIncrement()}");
     _createActorThroughput = context.GetCounter(CreateThroughputCounter);
 }
示例#25
0
 public void BenchmarkTestMethod(BenchmarkContext context)
 {
     _counter.Increment();
 }
 public void Tcp_Duplex_Throughput(BenchmarkContext context)
 {
     client.Tell(message);
     resetEvent.Wait(this.Timeout);
 }
 public void Cleanup(BenchmarkContext context)
 {
     Task.Run(NoWorkMethod).Wait();
     ReflectionBenchmarkInvokerSpecs.CleanupContextSet = context != null;
 }
        public override void Setup(BenchmarkContext context)
        {
            base.Setup(context);

            FilePairsLoaded = context.GetCounter(nameof(FilePairsLoaded));
        }
 public void Run(BenchmarkContext context)
 {
     _counter.Increment();
 }
示例#30
0
 public void SetUp(BenchmarkContext context)
 {
     _executor           = CreateExecutor();
     _executorThroughput = context.GetCounter(EventExecutorThroughputCounterName);
 }
示例#31
0
 public void Setup(BenchmarkContext context)
 {
     _parseThroughput = context.GetCounter(ParseThroughputCounterName);
 }
示例#32
0
#pragma warning disable xUnit1013 // Public method should be marked as test
        public void Cleanup(BenchmarkContext context)
#pragma warning restore xUnit1013 // Public method should be marked as test
        {
            _dictionary.Clear();
        }
 public void BenchmarkSetupMethod(BenchmarkContext context)
 {
     _counter = context.GetCounter(CounterName.CounterName);
 }
示例#34
0
#pragma warning disable xUnit1013 // Public method should be marked as test
        public void Setup(BenchmarkContext context)
#pragma warning restore xUnit1013 // Public method should be marked as test
        {
            _addCounter = context.GetCounter(AddCounterName);
            _key        = 0;
        }
 public void InvokeRun(BenchmarkContext context)
 {
     _runAction(context);
 }
示例#36
0
 public void SetUp(BenchmarkContext context)
 {
     _fiber           = CreateFiber();
     _fiberThroughput = context.GetCounter(FiberThroughputCounterName);
 }
示例#37
0
 public void Setup(BenchmarkContext context)
 {
     context.Trace.Debug(SetupTrace);
 }
示例#38
0
 public void Cleanup(BenchmarkContext context)
 {
 }
示例#39
0
 public void Run1(BenchmarkContext context)
 {
     context.Trace.Debug(RunTrace);
 }
示例#40
0
 public TestController(BenchmarkContext benchmarkContext)
 {
     _benchmarkContext = benchmarkContext;
 }
示例#41
0
 public void Teardown(BenchmarkContext context)
 {
     _system.Terminate().Wait(TimeSpan.FromSeconds(2.0d));
     _system = null;
 }
示例#42
0
 public void BenchMarkMethod_GetAllTasks(BenchmarkContext context)
 {
     ProjectDbService       _dbSvc       = new ProjectDbService();
     IEnumerable <DAL.Task> allTasksList = _dbSvc.GetAllTasks().ToList();
 }
示例#43
0
 public void ParseRemoteThroughput(BenchmarkContext context)
 {
     Address.Parse("akka://sys");
     _parseThroughput.Increment();
 }
示例#44
0
        public void BenchMarkMethod_GetTaskById(BenchmarkContext context)
        {
            ProjectDbService _dbSvc = new ProjectDbService();

            DAL.Task tskObj = _dbSvc.GetTaskById(2315);
        }
 public void Run(BenchmarkContext context)
 {
     RunContextSet = SetupContextSet && !CleanupContextSet;
 }
示例#46
0
 public void BenchMarkMethod_GetAllParentTasks(BenchmarkContext context)
 {
     ProjectDbService         _dbSvc         = new ProjectDbService();
     IEnumerable <ParentTask> lstParentTasks = _dbSvc.GetAllParentTasks();
 }
 public void Run(BenchmarkContext context)
 {
     ReflectionBenchmarkInvokerSpecs.RunContextSet = context != null;
 }
示例#48
0
 public void BenchMarkMethod_GetAllUsers(BenchmarkContext context)
 {
     ProjectDbService  _dbSvc  = new ProjectDbService();
     IEnumerable <Usr> lstUsrs = _dbSvc.GetAllUsers();
 }
            public void Setup(BenchmarkContext context)
            {

            }
示例#50
0
 public override void Setup(BenchmarkContext context)
 {
     base.Setup(context);
     _writeCounter = context.GetCounter(WriteCounterName);
 }
            public void Cleanup(BenchmarkContext context)
            {

            }
 public void InvokePerfCleanup(BenchmarkContext context)
 {
     _cleanupAction(context);
 }
 public void Setup(BenchmarkContext context)
 {
     _counter = context.GetCounter("TestCounter");
 }
 public override void Setup(BenchmarkContext context)
 {
     base.Setup(context);
     InitStreamWith((sbyte)-120);
 }
示例#55
0
 public void Cleanup(BenchmarkContext context)
 {
     context.Trace.Info(CleanupTrace);
 }
 public void Setup(BenchmarkContext context)
 {
     _counter1 = context.GetCounter("Counter1");
     _counter2 = context.GetCounter("Counter2");
 }
 public void SetUp(BenchmarkContext context)
 {
     _counter = context.GetCounter(CounterName);
 }
 public void SetUp(BenchmarkContext ctx) => _counter = ctx.GetCounter("Counter");
示例#59
0
 public void Setup(BenchmarkContext context)
 {
     sim = BenchmarkUtils.CreateCellBasedSim(context.Trace, 24, 50, 50, 12000, 72000, 0.005f);
 }
示例#60
0
 #pragma warning disable xUnit1013 // Public method should be marked as test
 public void Setup(BenchmarkContext context)
 #pragma warning restore xUnit1013 // Public method should be marked as test
 {
     _counter = context.GetCounter("Iterations");
 }