Skip to content

Commit

Permalink
now that build N-1 also uses JSON, remove CSV support
Browse files Browse the repository at this point in the history
  • Loading branch information
mtfriesen committed Jan 10, 2025
1 parent dd24d38 commit f3769a9
Showing 1 changed file with 1 addition and 24 deletions.
25 changes: 1 addition & 24 deletions tools/perfcompare.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,11 @@ param (
Set-StrictMode -Version 'Latest'
$ErrorActionPreference = 'Stop'

function ImportCsvDataset {
param($File)

$dataset = [ordered]@{}

$contents = Get-Content $File

foreach ($line in $contents) {
$array = $line.Split(",")
$scenarioName = $array[0]
$scenarioData = $array[3..$array.Count]
$dataset.Add($scenarioName, $scenarioData)
}

return $dataset
}

function ImportDataset {
param($File)

$dataset = [ordered]@{}

try {
$contents = Get-Content -Raw $File | ConvertFrom-Json
} catch {
Write-Warning "Failed to parse $File as JSON. Attempting to parse as legacy CSV."
return ImportCsvDataset $File
}
$contents = Get-Content -Raw $File | ConvertFrom-Json

foreach ($data in $contents) {
$scenarioName = $data.ScenarioName
Expand Down

0 comments on commit f3769a9

Please sign in to comment.