Skip to content

Commit bee82de

Browse files
henrymercerCopilot
andcommitted
Add tools download durations to the init status report
Surface `tools_extraction_duration_ms` and `tools_total_duration_ms` from both the `init` and `setup-codeql` actions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 628ce334-991a-4578-9c1b-93d2e96bbddb
1 parent c05e445 commit bee82de

3 files changed

Lines changed: 30 additions & 1 deletion

File tree

‎src/init-action.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,14 @@ async function sendCompletedStatusReport(
174174
initToolsDownloadFields.tools_download_duration_ms =
175175
toolsDownloadStatusReport.downloadDurationMs;
176176
}
177+
if (toolsDownloadStatusReport?.extractionDurationMs !== undefined) {
178+
initToolsDownloadFields.tools_extraction_duration_ms =
179+
toolsDownloadStatusReport.extractionDurationMs;
180+
}
181+
if (toolsDownloadStatusReport?.totalDurationMs !== undefined) {
182+
initToolsDownloadFields.tools_total_duration_ms =
183+
toolsDownloadStatusReport.totalDurationMs;
184+
}
177185
if (toolsFeatureFlagsValid !== undefined) {
178186
initToolsDownloadFields.tools_feature_flags_valid = toolsFeatureFlagsValid;
179187
}

‎src/setup-codeql-action.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,14 @@ async function sendCompletedStatusReport(
8585
initToolsDownloadFields.tools_download_duration_ms =
8686
toolsDownloadStatusReport.downloadDurationMs;
8787
}
88+
if (toolsDownloadStatusReport?.extractionDurationMs !== undefined) {
89+
initToolsDownloadFields.tools_extraction_duration_ms =
90+
toolsDownloadStatusReport.extractionDurationMs;
91+
}
92+
if (toolsDownloadStatusReport?.totalDurationMs !== undefined) {
93+
initToolsDownloadFields.tools_total_duration_ms =
94+
toolsDownloadStatusReport.totalDurationMs;
95+
}
8896
if (toolsFeatureFlagsValid !== undefined) {
8997
initToolsDownloadFields.tools_feature_flags_valid = toolsFeatureFlagsValid;
9098
}

‎src/status-report.ts‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,8 +620,21 @@ export interface InitWithConfigStatusReport extends InitStatusReport {
620620

621621
/** Fields of the init status report populated when the tools source is `download`. */
622622
export interface InitToolsDownloadFields {
623-
/** Time taken to download the bundle, in milliseconds. */
623+
/**
624+
* Time taken to download the bundle, in milliseconds. Not populated when the bundle is downloaded
625+
* and extracted concurrently.
626+
*/
624627
tools_download_duration_ms?: number;
628+
/**
629+
* Time taken to extract the bundle, in milliseconds. Not populated when the bundle is downloaded
630+
* and extracted concurrently.
631+
*/
632+
tools_extraction_duration_ms?: number;
633+
/**
634+
* Total time taken to make the bundle available on disk, in milliseconds. This includes any time
635+
* spent on a streaming attempt that failed and fell back to downloading before extracting.
636+
*/
637+
tools_total_duration_ms?: number;
625638
/**
626639
* Whether the relevant tools dotcom feature flags have been misconfigured.
627640
* Only populated if we attempt to determine the default version based on the dotcom feature flags. */

0 commit comments

Comments
 (0)