Skip to content

Commit

Permalink
Fixed a bug and added Lua
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenge committed Sep 5, 2024
1 parent 2d7d180 commit 7e2368c
Showing 1 changed file with 48 additions and 8 deletions.
56 changes: 48 additions & 8 deletions test/BDNPerfTests/run_bdnperftest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,6 @@ $OFS = "`r`n"
function AnalyzeResult {
param ($foundResultValue, $expectedResultValue, $acceptablePercentRange, $warnonly)

# Just dobule check found results
if ($foundResultsValue -eq "NA") {
Write-Host "** << Data Error! >> The BDN benchmark Mean Value is not a valid value. Mean value found: $dblfoundResultValue"
Write-Host "** "

return $false
}

# Calculate the lower and upper bounds of the expected value
[double] $Tolerance = $acceptablePercentRange / 100
[double] $LowerBound = $expectedResultValue * (1 - $Tolerance)
Expand Down Expand Up @@ -84,6 +76,14 @@ param ($ResultsLine, $columnNum)
$column = $columns | ForEach-Object { $_.Trim() }
$foundValue = $column[$columnNum].Trim(' us')

# Just double check found results is not NA
if ($foundResultsValue -eq "NA") {
Write-Error -Message "** << Data Error! >> The BDN benchmark Mean Value is not a valid value. Mean value found: $dblfoundResultValue"
Write-Host "** "

return 0
}

return $foundValue
}

Expand Down Expand Up @@ -168,6 +168,10 @@ if ($IsLinux) {
$expectedMGetMeanValue = $object.expectedMGETMeanValue_linux
$expectedMSetMeanValue = $object.expectedMSETMeanValue_linux
$expectedIncrMeanValue = $object.expectedIncrMeanValue_linux
$expectedBasicLua1MeanValue = $object.expectedBasicLua1MeanValue_linux
$expectedBasicLua2MeanValue = $object.expectedBasicLua2MeanValue_linux
$expectedBasicLua3MeanValue = $object.expectedBasicLua3MeanValue_linux
$expectedBasicLua4MeanValue = $object.expectedBasicLua3MeanValue_linux
}
else {
# Windows expected values
Expand All @@ -183,6 +187,10 @@ else {
$expectedMGetMeanValue = $object.expectedMGETMeanValue_win
$expectedMSetMeanValue = $object.expectedMSETMeanValue_win
$expectedIncrMeanValue = $object.expectedIncrMeanValue_win
$expectedBasicLua1MeanValue = $object.expectedBasicLua1MeanValue_win
$expectedBasicLua2MeanValue = $object.expectedBasicLua2MeanValue_win
$expectedBasicLua3MeanValue = $object.expectedBasicLua3MeanValue_win
$expectedBasicLua4MeanValue = $object.expectedBasicLua3MeanValue_win
}

# percent allowed variance when comparing expected vs actual found value - same for linux and windows.
Expand Down Expand Up @@ -359,6 +367,38 @@ Get-Content $resultsFile | ForEach-Object {
$testSuiteResult = $false
}
}
"*| BasicLua1*" {
Write-Host "** BasicLua1 Mean Value test"
$foundBasicLua1MeanValue = ParseValueFromResults $line $meanColumn
$currentResults = AnalyzeResult $foundBasicLua1MeanValue $expectedBasicLua1MeanValue $acceptableMeanRange $true
if ($currentResults -eq $false) {
$testSuiteResult = $false
}
}
"*| BasicLua2*" {
Write-Host "** BasicLua2 Mean Value test"
$foundBasicLua2MeanValue = ParseValueFromResults $line $meanColumn
$currentResults = AnalyzeResult $foundBasicLua2MeanValue $expectedBasicLua2MeanValue $acceptableMeanRange $true
if ($currentResults -eq $false) {
$testSuiteResult = $false
}
}
"*| BasicLua3*" {
Write-Host "** BasicLua3 Mean Value test"
$foundBasicLua3MeanValue = ParseValueFromResults $line $meanColumn
$currentResults = AnalyzeResult $foundBasicLua3MeanValue $expectedBasicLua3MeanValue $acceptableMeanRange $true
if ($currentResults -eq $false) {
$testSuiteResult = $false
}
}
"*| BasicLua4*" {
Write-Host "** BasicLua4 Mean Value test"
$foundBasicLua4MeanValue = ParseValueFromResults $line $meanColumn
$currentResults = AnalyzeResult $foundBasicLua4MeanValue $expectedBasicLua4MeanValue $acceptableMeanRange $true
if ($currentResults -eq $false) {
$testSuiteResult = $false
}
}
}
}

Expand Down

0 comments on commit 7e2368c

Please sign in to comment.