mirror of
https://github.com/actions/setup-go.git
synced 2026-04-06 12:49:24 +00:00
perf: log cache directory sizes for visibility
Log GOMODCACHE and GOCACHE sizes (in human-readable format) after restore and before save. This helps diagnose cache bloat and monitor the impact of cache-build settings. https://claude.ai/code/session_01CqrWSjzGgd7Zi6LyJkd9XW
This commit is contained in:
parent
cf0b11600c
commit
867e185dcc
5 changed files with 141 additions and 4 deletions
|
|
@ -2,7 +2,11 @@ import * as core from '@actions/core';
|
|||
import * as cache from '@actions/cache';
|
||||
import fs from 'fs';
|
||||
import {State} from './constants';
|
||||
import {getCacheDirectoryPath, getPackageManagerInfo} from './cache-utils';
|
||||
import {
|
||||
getCacheDirectoryPath,
|
||||
getPackageManagerInfo,
|
||||
logCacheSizes
|
||||
} from './cache-utils';
|
||||
import {computeMetaHash} from './hashdir';
|
||||
|
||||
// Catch and log any unhandled exceptions. These exceptions can leak out of the uploadChunk method in
|
||||
|
|
@ -87,6 +91,8 @@ const cachePackages = async () => {
|
|||
return;
|
||||
}
|
||||
|
||||
logCacheSizes(cachePaths);
|
||||
|
||||
const updatedKey = primaryKey + (buildHash ? `-${buildHash}` : '');
|
||||
const start = Date.now();
|
||||
const cacheId = await cache.saveCache(cachePaths, updatedKey);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue