Dump to console in a readable format.
()
| 149 | |
| 150 | /** Dump to console in a readable format. */ |
| 151 | dump(): void { |
| 152 | console.group('[PipelineDebug] Event log'); |
| 153 | for (const e of this.entries) { |
| 154 | console.log( |
| 155 | `%c+${e.elapsed.toFixed(1)}ms%c ${e.label} %c${e.detail ?? ''}`, |
| 156 | 'color: gray', |
| 157 | 'color: white; font-weight: bold', |
| 158 | 'color: cyan', |
| 159 | ); |
| 160 | } |
| 161 | console.groupEnd(); |
| 162 | |
| 163 | const s = this.summary(); |
| 164 | if (Object.keys(s).length > 0) { |
| 165 | console.group('[PipelineDebug] Stage summary'); |
| 166 | for (const [stage, info] of Object.entries(s)) { |
| 167 | console.log( |
| 168 | `${stage}: ${info.count} items in ${info.totalMs.toFixed(1)}ms (avg ${(info.totalMs / Math.max(info.count, 1)).toFixed(1)}ms)`, |
| 169 | ); |
| 170 | } |
| 171 | console.groupEnd(); |
| 172 | } |
| 173 | } |
| 174 | } |
no test coverage detected