/
githubmirror
/
PowerShell
Обзор
Документация
Войти
/
githubmirror
/
PowerShell
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
test/perf/dotnet-tools/Reporting/Test.cs
43 строки
1 KB
Dongbo Wang
Add the performance benchmark project for PowerShell performance testing (#15242)
30 апр 2021, 19:34
Не верифицирован
30 апр 2021, 19:34
a62c9d9
Код
Авторство
О чём код?
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; namespace Reporting { public class Test { public IList<string> Categories { get; set; } = new List<string>(); public string Name { get; set; } public Dictionary<string, string> AdditionalData { get; set; } = new Dictionary<string, string>(); public IList<Counter> Counters { get; set; } = new List<Counter>(); public void AddCounter(Counter counter) { if (counter.DefaultCounter && Counters.Any(c => c.DefaultCounter)) { throw new Exception($"Duplicate default counter, name: ${counter.Name}"); } if (Counters.Any(c => c.Name.Equals(counter.Name))) { throw new Exception($"Duplicate counter name, name: ${counter.Name}"); } Counters.Add(counter); } public void AddCounter(IEnumerable<Counter> counters) { foreach (var counter in counters) AddCounter(counter); } } }