(category, getDuration, getParallelism)
| 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 |
nothing calls this directly
no test coverage detected