Created
December 22, 2020 00:14
-
-
Save RikkiGibson/1510ca398611f0047a061bb449675730 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script scrapes AzDo data and writes out a CSV of build runtimes | |
$roslynPipelineId = "15" | |
$baseURL = "https://dev.azure.com/dnceng/public/_apis/" | |
$runsURL = "$baseURL/pipelines/$roslynPipelineId/runs?api-version=6.0-preview.1" | |
$buildsURL = "$baseURL/build/builds/" | |
$runs = (Invoke-WebRequest -uri $runsURL | ConvertFrom-Json) | |
$wantedRecords = @( | |
"Build_Windows_Debug", | |
"Build_Windows_Release", | |
"Build_Unix_Debug", | |
"Correctness_Determinism", | |
"Correctness_Build", | |
"Correctness_SourceBuild", | |
"Test_Windows_Desktop_Debug_32", | |
"Test_Windows_Desktop_Spanish_Debug_32", | |
"Test_Windows_Desktop_Debug_64", | |
"Test_Windows_CoreClr_Debug", | |
"Test_Windows_Desktop_Release_32", | |
"Test_Windows_Desktop_Release_64", | |
"Test_Windows_CoreClr_Release", | |
"Test_Linux_Debug", | |
"Test_macOS_Debug") | |
[System.Collections.ArrayList]$allRuns = @() | |
foreach ($run in $runs.value[0..10]) { | |
if ($run.result -eq "succeeded") { | |
$timelineURL = "$buildsURL/$($run.id)/timeline" | |
$timeline = (Invoke-WebRequest -uri $timelineURL | ConvertFrom-Json) | |
foreach ($record in $timeline.records) { | |
if ($wantedRecords.Contains($record.name)) { | |
$allRuns.Add([PSCustomObject]@{ | |
startTime = $record.startTime; | |
endTime = $record.endTime; | |
}) | |
} | |
} | |
} | |
} | |
Export-Csv -InputObject $allRuns -Path "ci-times.csv" -NoTypeInformation |
jschneidereit
commented
Dec 22, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment