Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Record telemetry for cache operation duration
  • Loading branch information
henrymercer committed Dec 3, 2024
commit 7bcf845de9909d8a0ff1e1021a933551089e84d1
9 changes: 7 additions & 2 deletions lib/setup-codeql.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/setup-codeql.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/tools-download.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions src/setup-codeql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ export const downloadCodeQL = async function (
? toolcacheInfo.path
: getTempExtractionDir(tempDir);

const statusReport = await downloadAndExtract(
let statusReport = await downloadAndExtract(
codeqlURL,
extractedBundlePath,
authorization,
Expand Down Expand Up @@ -585,11 +585,16 @@ export const downloadCodeQL = async function (
toolcacheInfo.version,
);

const cacheDurationMs = performance.now() - toolcacheStart;
logger.info(
`Added CodeQL bundle to the tool cache (${formatDuration(
performance.now() - toolcacheStart,
cacheDurationMs,
)}).`,
);
statusReport = {
...statusReport,
cacheDurationMs,
};

// Defensive check: we expect `cacheDir` to copy the bundle to a new location.
if (codeqlFolder !== extractedBundlePath) {
Expand Down
1 change: 1 addition & 0 deletions src/tools-download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ type ToolsDownloadDurations =
| StreamedToolsDownloadDurations;

export type ToolsDownloadStatusReport = {
cacheDurationMs?: number;
compressionMethod: tar.CompressionMethod;
toolsUrl: string;
zstdFailureReason?: string;
Expand Down