Skip to content

Commit f0f91f1

Browse files
authored
Crank http/https toggle param (#6593)
1 parent fd9176c commit f0f91f1

File tree

2 files changed

+31
-7
lines changed

2 files changed

+31
-7
lines changed

tools/Crank/benchmarks.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ scenarios:
1515
job: server
1616
environmentVariables:
1717
AzureWebJobsScriptRoot: "{{ FunctionAppPath }}"
18-
ASPNETCORE_URLS: "http://localhost:5000;https://localhost:5001"
18+
ASPNETCORE_URLS: "{{ AspNetUrls }}"
1919
load:
2020
job: bombardier
2121
variables:
@@ -30,7 +30,7 @@ scenarios:
3030
WEBSITE_INSTANCE_ID: "8399B720-AB73-46D6-94DE-5A27871B3155"
3131
WEBSITE_OWNER_NAME: "A5F47496-A284-4788-A127-E79454330567+westuswebspace"
3232
AzureWebJobsScriptRoot: "{{ FunctionAppPath }}"
33-
ASPNETCORE_URLS: "http://localhost:5000;https://localhost:5001"
33+
ASPNETCORE_URLS: "{{ AspNetUrls }}"
3434
load:
3535
job: bombardier
3636
variables:
@@ -46,15 +46,15 @@ scenarios:
4646
WEBSITE_OWNER_NAME: "A5F47496-A284-4788-A127-E79454330567+westuswebspace"
4747
FUNCTIONS_LOGS_MOUNT_PATH: "{{ TempLogPath }}"
4848
AzureWebJobsScriptRoot: "{{ FunctionAppPath }}"
49-
ASPNETCORE_URLS: "http://localhost:5000;https://localhost:5001"
49+
ASPNETCORE_URLS: "{{ AspNetUrls }}"
5050
load:
5151
job: bombardier
5252
variables:
5353
path: /api/Hello
5454
duration: 180
5555

5656
profiles:
57-
local:
57+
localHttps:
5858
variables:
5959
serverUri: https://localhost
6060
serverPort: 5001
@@ -65,3 +65,14 @@ profiles:
6565
load:
6666
endpoints:
6767
- "http://{{ CrankAgentVm }}:5010"
68+
local:
69+
variables:
70+
serverUri: http://localhost
71+
serverPort: 5000
72+
jobs:
73+
application:
74+
endpoints:
75+
- "http://{{ CrankAgentVm }}:5010"
76+
load:
77+
endpoints:
78+
- "http://{{ CrankAgentVm }}:5010"

tools/Crank/run-benchmarks.ps1

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ param(
2222
$RefreshCrankContoller,
2323

2424
[string]
25-
$UserName = 'Functions'
25+
$UserName = 'Functions',
26+
27+
[bool]
28+
$UseHttps = $true
2629
)
2730

2831
$ErrorActionPreference = 'Stop'
@@ -69,15 +72,25 @@ $functionAppPath = Join-Path `
6972
$tmpPath = if ($isLinuxApp) { "/tmp" } else { 'C:\Temp' }
7073
$tmpLogPath = if ($isLinuxApp) { "/tmp/functions/log" } else { 'C:\Temp\Functions\Log' }
7174

75+
if ($UseHttps) {
76+
$aspNetUrls = "http://localhost:5000;https://localhost:5001"
77+
$profile = "localHttps"
78+
}
79+
else {
80+
$aspNetUrls = "http://localhost:5000"
81+
$profile = "local"
82+
}
83+
7284
$crankArgs =
7385
'--config', $crankConfigPath,
7486
'--scenario', $Scenario,
75-
'--profile', 'local',
87+
'--profile', $profile,
7688
'--variable', "CrankAgentVm=$CrankAgentVm",
7789
'--variable', "FunctionAppPath=`"$functionAppPath`"",
7890
'--variable', "TempPath=`"$tmpPath`"",
7991
'--variable', "TempLogPath=`"$tmpLogPath`"",
80-
'--variable', "BranchOrCommit=$BranchOrCommit"
92+
'--variable', "BranchOrCommit=$BranchOrCommit",
93+
'--variable', "AspNetUrls=$aspNetUrls"
8194

8295
if ($WriteResultsToDatabase) {
8396
Set-AzContext -Subscription 'Antares-Demo' > $null

0 commit comments

Comments
 (0)