diff --git a/src/init-action.ts b/src/init-action.ts index 6b5ed392e..8173d67aa 100644 --- a/src/init-action.ts +++ b/src/init-action.ts @@ -174,6 +174,14 @@ async function sendCompletedStatusReport( initToolsDownloadFields.tools_download_duration_ms = 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) { initToolsDownloadFields.tools_feature_flags_valid = toolsFeatureFlagsValid; } diff --git a/src/setup-codeql-action.ts b/src/setup-codeql-action.ts index 7873449f9..bb6b73c9a 100644 --- a/src/setup-codeql-action.ts +++ b/src/setup-codeql-action.ts @@ -85,6 +85,14 @@ async function sendCompletedStatusReport( initToolsDownloadFields.tools_download_duration_ms = 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) { initToolsDownloadFields.tools_feature_flags_valid = toolsFeatureFlagsValid; } diff --git a/src/status-report.ts b/src/status-report.ts index e61b04f9d..57020c394 100644 --- a/src/status-report.ts +++ b/src/status-report.ts @@ -620,8 +620,21 @@ export interface InitWithConfigStatusReport extends InitStatusReport { /** Fields of the init status report populated when the tools source is `download`. */ 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; + /** + * 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. * Only populated if we attempt to determine the default version based on the dotcom feature flags. */