Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | /** * Metrics Collector for Performance Profiler */ export class MetricsCollector { constructor(options = {}) { this.options = options; this.collectors = new Map(); } addCollector(name, collector) { this.collectors.set(name, collector); } async collect() { const results = {}; for (const [name, collector] of this.collectors) { try { results[name] = await collector.collect(); } catch (error) { results[name] = { error: error.message }; } } return results; } createRenderingCollector() { return { collect: () => ({ renderCount: 0, averageRenderTime: 0, slowestRender: 0 }) }; } } |