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
This commit is contained in:
Henry Mercer
2026-08-24 18:32:08 +01:00
parent c05e445696
commit bee82de8ba
3 changed files with 30 additions and 1 deletions

View File

@@ -174,6 +174,14 @@ async function sendCompletedStatusReport(
initToolsDownloadFields.tools_download_duration_ms = initToolsDownloadFields.tools_download_duration_ms =
toolsDownloadStatusReport.downloadDurationMs; toolsDownloadStatusReport.downloadDurationMs;
} }
if (toolsDownloadStatusReport?.extractionDurationMs !== undefined) {
initToolsDownloadFields.tools_extraction_duration_ms =
toolsDownloadStatusReport.extractionDurationMs;
}
if (toolsDownloadStatusReport?.totalDurationMs !== undefined) {
initToolsDownloadFields.tools_total_duration_ms =
toolsDownloadStatusReport.totalDurationMs;
}
if (toolsFeatureFlagsValid !== undefined) { if (toolsFeatureFlagsValid !== undefined) {
initToolsDownloadFields.tools_feature_flags_valid = toolsFeatureFlagsValid; initToolsDownloadFields.tools_feature_flags_valid = toolsFeatureFlagsValid;
} }

View File

@@ -85,6 +85,14 @@ async function sendCompletedStatusReport(
initToolsDownloadFields.tools_download_duration_ms = initToolsDownloadFields.tools_download_duration_ms =
toolsDownloadStatusReport.downloadDurationMs; toolsDownloadStatusReport.downloadDurationMs;
} }
if (toolsDownloadStatusReport?.extractionDurationMs !== undefined) {
initToolsDownloadFields.tools_extraction_duration_ms =
toolsDownloadStatusReport.extractionDurationMs;
}
if (toolsDownloadStatusReport?.totalDurationMs !== undefined) {
initToolsDownloadFields.tools_total_duration_ms =
toolsDownloadStatusReport.totalDurationMs;
}
if (toolsFeatureFlagsValid !== undefined) { if (toolsFeatureFlagsValid !== undefined) {
initToolsDownloadFields.tools_feature_flags_valid = toolsFeatureFlagsValid; initToolsDownloadFields.tools_feature_flags_valid = toolsFeatureFlagsValid;
} }

View File

@@ -620,8 +620,21 @@ export interface InitWithConfigStatusReport extends InitStatusReport {
/** Fields of the init status report populated when the tools source is `download`. */ /** Fields of the init status report populated when the tools source is `download`. */
export interface InitToolsDownloadFields { export interface InitToolsDownloadFields {
/** Time taken to download the bundle, in milliseconds. */ /**
* Time taken to download the bundle, in milliseconds. Not populated when the bundle is downloaded
* and extracted concurrently.
*/
tools_download_duration_ms?: number; tools_download_duration_ms?: number;
/**
* Time taken to extract the bundle, in milliseconds. Not populated when the bundle is downloaded
* and extracted concurrently.
*/
tools_extraction_duration_ms?: number;
/**
* Total time taken to make the bundle available on disk, in milliseconds. This includes any time
* spent on a streaming attempt that failed and fell back to downloading before extracting.
*/
tools_total_duration_ms?: number;
/** /**
* Whether the relevant tools dotcom feature flags have been misconfigured. * Whether the relevant tools dotcom feature flags have been misconfigured.
* Only populated if we attempt to determine the default version based on the dotcom feature flags. */ * Only populated if we attempt to determine the default version based on the dotcom feature flags. */