public async Task SetGroupingAsync(Grouping grouping) { if (_discoveredBenchmarks.Count == 0) { return; } BenchmarkNodeBuilder nodeBuilder = new BenchmarkNodeBuilder(this, grouping); await nodeBuilder.RebuildNodesAsync(_discoveredBenchmarks); }
public async Task RefreshAsync(IBenchmarkDiscoverer discoverer, Grouping grouping) { _discoveredBenchmarks.Clear(); var benchmarks = discoverer.FindBenchmarks().Select(b => { _discoveredBenchmarks.Add(b); return(b); }); BenchmarkTreeNode previousSelection = SelectedBenchmark; BenchmarkNodeBuilder nodeBuilder = new BenchmarkNodeBuilder(this, grouping); await nodeBuilder.RebuildNodesAsync(benchmarks); if (Nodes.Sum(n => n.TotalNodeCount) <= 20) { ExpandAll(); } if (previousSelection != null) { ExpandAndSelectNode(previousSelection); } }