Exemplo n.º 1
0
        private void RunAsync()
        {
            try
            {
                var metric   = new BenchmarkMetrics();
                var taskList = new List <Task>();

                var count = _countData == -1 ? _countData : _countData / _countThreads;

                for (int i = 0; i < _countThreads; i++)
                {
                    if (_countData != -1 && i == _countThreads - 1 && _countData % _countThreads != 0)
                    {
                        count += _countData % _countThreads;
                    }

                    taskList.Add(CreateThread(metric, count));
                }

                Task.WaitAll(taskList.ToArray(), _token.Token);

                metric.CreateStatistics();
            }

            catch (OperationCanceledException)
            {
            }
        }
Exemplo n.º 2
0
        public GameState()
        {
            Metrics         = new BenchmarkMetrics();
            SpriteBatchList = new SpriteBatchList();
            SoundEffectList = new SoundEffectList();

            GameData = new GameData();
        }
Exemplo n.º 3
0
        private Task CreateThread(BenchmarkMetrics metrics, int count)
        {
            var tests = _testFactory.Select(x => x()).ToList();

            tests.ForEach(x => CreateMetrics(x, metrics));

            return(Task.Factory.StartNew(() => ThreadTest(tests, count)));
        }
Exemplo n.º 4
0
 private void CreateMetrics(LoadTest test, BenchmarkMetrics metrics)
 {
     test.CreateMetric(metrics);
 }
Exemplo n.º 5
0
 public override void CreateMetric(BenchmarkMetrics metrics)
 {
     _metric = metrics.GetAvgMetric("SET");
 }
Exemplo n.º 6
0
 public override void CreateMetric(BenchmarkMetrics metrics)
 {
     _metrics = metrics.GetMetricsCollection("COLLECTOR");
     _metrics.AddMetrics(new AvgMetric(MetricName.PackageData));
     _metrics.AddMetrics(new AvgMetric(MetricName.Single));
 }
Exemplo n.º 7
0
 public abstract void CreateMetric(BenchmarkMetrics metrics);