Skip to content

Commit

Permalink
adjust SQL strings
Browse files Browse the repository at this point in the history
  • Loading branch information
ProjectsByJackHe committed Jan 11, 2024
1 parent 1558e63 commit 780f97a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 28 deletions.
19 changes: 15 additions & 4 deletions scripts/secnetperf-helpers.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function Stop-RemoteServer {
}

# Invokes all the secnetperf tests.
function Invoke-SecnetperfTest($testIds, $commands, $exe, $json, $LogProfile) {
function Invoke-SecnetperfTest($MsQuicCommit, $commands, $exe, $json, $LogProfile) {

Write-Host "Running Secnetperf tests..."

Expand All @@ -77,8 +77,13 @@ function Invoke-SecnetperfTest($testIds, $commands, $exe, $json, $LogProfile) {
$json = @{}

for ($i = 0; $i -lt $commands.Count; $i++) {
$testid = $i + 1
for ($tcp = 0; $tcp -lt 2; $tcp++) {

$SQL += @"
INSERT OR IGNORE INTO Secnetperf_tests (Secnetperf_test_ID, Kernel_mode, Run_arguments) VALUES ($testid, 0, "$($commands[$i]) -tcp:$tcp")
"@

$command = "$exe -target:netperf-peer $($commands[$i]) -tcp:$tcp -trimout"
Write-Host "> $command"

Expand Down Expand Up @@ -110,6 +115,12 @@ function Invoke-SecnetperfTest($testIds, $commands, $exe, $json, $LogProfile) {
continue
}

$env = 2

if ($isWindows) {
$env = 1
}

Write-Host $rawOutput

if ($testIds[$i].Contains("rps")) {
Expand All @@ -135,11 +146,11 @@ function Invoke-SecnetperfTest($testIds, $commands, $exe, $json, $LogProfile) {

$num = $matches[1]

# Generate SQL statement
# Generate SQL statement. Assume LAST_INSERT_ROW_ID()
$SQL += @"
INSERT INTO Secnetperf_test_runs (Secnetperf_test_ID, Client_environment_ID, Server_environment_ID, Result, Latency_stats_ID, Units)
VALUES ('$($testIds[$i])', 'azure_vm', 'azure_vm', $num, NULL, 'kbps');
INSERT INTO Secnetperf_test_runs (Secnetperf_test_ID, Secnetperf_commit, Client_environment_ID, Server_environment_ID, Result, Latency_stats_ID)
VALUES ($testid, '$MsQuicCommit', $env, $env, $num, NULL);
"@

Expand Down
26 changes: 2 additions & 24 deletions scripts/secnetperf.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -140,34 +140,12 @@ $SQL = @"
INSERT OR IGNORE INTO Secnetperf_builds (Secnetperf_Commit, Build_date_time, TLS_enabled, Advanced_build_config)
VALUES ('$MsQuicCommit', '$(Get-Date -Format "yyyy-MM-dd HH:mm:ss")', 1, 'TODO');
INSERT OR IGNORE INTO Secnetperf_tests (Secnetperf_test_ID, Secnetperf_build_ID, Kernel_mode, Run_arguments, Test_name)
VALUES ('throughput-upload-quic-$MsQuicCommit', '$MsQuicCommit', 0, '-target:netperf-peer -exec:maxtput -upload:10s', 'throughput-upload-quic');
INSERT OR IGNORE INTO Secnetperf_tests (Secnetperf_test_ID, Secnetperf_build_ID, Kernel_mode, Run_arguments, Test_name)
VALUES ('throughput-upload-tcp-$MsQuicCommit', '$MsQuicCommit', 0, '-target:netperf-peer -exec:maxtput -upload:10s -tcp:1', 'throughput-upload-tcp');
INSERT OR IGNORE INTO Secnetperf_tests (Secnetperf_test_ID, Secnetperf_build_ID, Kernel_mode, Run_arguments, Test_name)
VALUES ('throughput-download-quic-$MsQuicCommit', '$MsQuicCommit', 0, '-target:netperf-peer -exec:maxtput -download:10s', 'throughput-download-quic');
INSERT OR IGNORE INTO Secnetperf_tests (Secnetperf_test_ID, Secnetperf_build_ID, Kernel_mode, Run_arguments, Test_name)
VALUES ('throughput-download-tcp-$MsQuicCommit', '$MsQuicCommit', 0, '-target:netperf-peer -exec:maxtput -download:10s -tcp:1', 'throughput-download-tcp');
"@

$exe = "./$SecNetPerfPath"

$json = @{}

$maxtputIds = @(
"throughput-upload",
"throughput-download",
"hps"
)

$lowlatIds = @(
"rps-1conn-1stream"
)

$maxtput = @(
"-exec:maxtput -up:10s -ptput:1",
"-exec:maxtput -down:10s -ptput:1",
Expand All @@ -178,14 +156,14 @@ $lowlat = @(
"-exec:lowlat -rstream:1 -up:512 -down:4000 -run:10s -plat:1"
)

$SQL += Invoke-SecnetperfTest $maxtputIds $maxtput $exe $json $LogProfile
$SQL += Invoke-SecnetperfTest $MsQuicCommit $maxtput $exe $json $LogProfile

# Start and restart the SecNetPerf server without maxtput.
Write-Host "Restarting server without maxtput..."
Stop-RemoteServer $Job $RemoteName
$Job = Start-RemoteServer $Session "$RemoteDir/$SecNetPerfPath -exec:lowlat"

$SQL += Invoke-SecnetperfTest $lowlatIds $lowlat $exe $json $LogProfile
$SQL += Invoke-SecnetperfTest $MsQuicCommit $lowlat $exe $json $LogProfile

####################################################################################################

Expand Down

0 comments on commit 780f97a

Please sign in to comment.