Skip to content

Commit b119e99

Browse files
committed
Added switch for interactive and non-interactive mode. Added PostData benchmarks.
1 parent 3beb56d commit b119e99

File tree

5 files changed

+497
-9
lines changed

5 files changed

+497
-9
lines changed

build/scripts/Benchmarking.fsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,18 +123,24 @@ module Benchmarker =
123123
let private benchmarkOutput = Path.GetFullPath(Paths.Output("benchmarks")) |> directoryInfo
124124
let private copyToOutput file = CopyFile benchmarkOutput.FullName file
125125

126-
let Run() =
126+
let Run(runInteractive:bool) =
127127

128128
ensureDirExists benchmarkOutput
129129

130130
let projectJson = testsProjectDirectory @@ "project.json"
131131

132132
// running benchmarks can timeout so clean up any generated benchmark files
133133
try
134-
DotNetCli.RunCommand(fun p ->
135-
{ p with
136-
WorkingDir = testsProjectDirectory
137-
}) "run -f net46 -c Release Benchmark non-interactive"
134+
if runInteractive then
135+
DotNetCli.RunCommand(fun p ->
136+
{ p with
137+
WorkingDir = testsProjectDirectory
138+
}) "run -f net46 -c Release Benchmark"
139+
else
140+
DotNetCli.RunCommand(fun p ->
141+
{ p with
142+
WorkingDir = testsProjectDirectory
143+
}) "run -f net46 -c Release Benchmark non-interactive"
138144
finally
139145
let benchmarkOutputFiles =
140146
let output = combinePaths testsProjectDirectory "BenchmarkDotNet.Artifacts"

build/scripts/Commandline.fsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,14 @@ module Commandline =
7979

8080
| ["benchmark"; IsUrl elasticsearch] ->
8181
setBuildParam "elasticsearch" elasticsearch
82+
setBuildParam "nonInteractive" "0"
83+
84+
| ["benchmark"; IsUrl elasticsearch; "non-interactive"] ->
85+
setBuildParam "elasticsearch" elasticsearch
86+
setBuildParam "nonInteractive" "1"
87+
88+
| ["benchmark"; "non-interactive"] ->
89+
setBuildParam "nonInteractive" "1"
8290

8391
| ["profile"; IsUrl elasticsearch] ->
8492
setBuildParam "elasticsearch" elasticsearch

build/scripts/Targets.fsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ Target "Profile" <| fun _ ->
4848

4949
Target "Integrate" <| Tests.RunIntegrationTests
5050

51-
Target "Benchmark" <| fun _ ->
52-
Benchmarker.Run()
51+
Target "Benchmark" <| fun _ ->
52+
let runInteractive = ((getBuildParam "nonInteractive") <> "1")
53+
Benchmarker.Run(runInteractive)
5354
let url = getBuildParam "elasticsearch"
5455
Benchmarker.IndexResults url
5556

0 commit comments

Comments
 (0)