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) { } }
public GameState() { Metrics = new BenchmarkMetrics(); SpriteBatchList = new SpriteBatchList(); SoundEffectList = new SoundEffectList(); GameData = new GameData(); }
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))); }
private void CreateMetrics(LoadTest test, BenchmarkMetrics metrics) { test.CreateMetric(metrics); }
public override void CreateMetric(BenchmarkMetrics metrics) { _metric = metrics.GetAvgMetric("SET"); }
public override void CreateMetric(BenchmarkMetrics metrics) { _metrics = metrics.GetMetricsCollection("COLLECTOR"); _metrics.AddMetrics(new AvgMetric(MetricName.PackageData)); _metrics.AddMetrics(new AvgMetric(MetricName.Single)); }
public abstract void CreateMetric(BenchmarkMetrics metrics);