-
Notifications
You must be signed in to change notification settings - Fork 450
Expand file tree
/
Copy pathProgram.cs
More file actions
30 lines (27 loc) · 909 Bytes
/
Program.cs
File metadata and controls
30 lines (27 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using BenchmarkDotNet.Running;
using WebApiClientCore.Benchmarks.Requests;
namespace WebApiClientCore.Benchmarks
{
class Program
{
static void Main(string[] args)
{
// 使用 BenchmarkSwitcher 支持命令行参数
// 这样可以通过 --filter, --exporters 等参数控制执行
var switcher = BenchmarkSwitcher.FromTypes(new[]
{
typeof(HttpGetBenchmark),
typeof(HttpGetJsonBenchmark),
typeof(HttpPostJsonBenchmark),
typeof(HttpPostXmlBenchmark),
typeof(HttpPutFormBenchmark)
});
// 如果没有传入参数,使用默认参数执行所有测试
if (args == null || args.Length == 0)
{
args = new[] { "--filter", "*" };
}
switcher.Run(args);
}
}
}