MCPcopy
hub / github.com/webpack/webpack / logNormalSummary

Method logNormalSummary

lib/Compilation.js:3274–3297  ·  view source on GitHub ↗
(category, getDuration, getParallelism)

Source from the content-addressed store, hash-verified

3272 * @param {(profile: ModuleProfile) => number} getParallelism get parallelism callback
3273 */
3274 const logNormalSummary = (category, getDuration, getParallelism) => {
3275 let sum = 0;
3276 let max = 0;
3277 for (const [module, profile] of modulesWithProfiles) {
3278 const p = getParallelism(profile);
3279 const d = getDuration(profile);
3280 if (d === 0 || p === 0) continue;
3281 const t = d / p;
3282 sum += t;
3283 if (t <= 10) continue;
3284 logByValue(
3285 t,
3286 ` | ${Math.round(t)} ms${
3287 p >= 1.1 ? ` (parallelism ${Math.round(p * 10) / 10})` : ""
3288 } ${category} > ${module.readableIdentifier(this.requestShortener)}`
3289 );
3290 max = Math.max(max, t);
3291 }
3292 if (sum <= 10) return;
3293 logByValue(
3294 Math.max(sum / 10, max),
3295 `${Math.round(sum)} ms ${category}`
3296 );
3297 };
3298 /**
3299 * Log by loaders summary.
3300 * @param {string} category a category

Callers

nothing calls this directly

Calls 1

readableIdentifierMethod · 0.45

Tested by

no test coverage detected