@hearsay-tools/squawk 0.19.0-dev.8679 → 0.19.0-dev.8689

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -165,6 +165,16 @@ export function summarizeWaits(seen) {
165
165
  return counts;
166
166
  }
167
167
 
168
+ /** Name the waits of every sample whose blocking reached the budget, not only the first one.
169
+ * `window(sample)` gives the sample's [from, to) on the performance.now() clock. */
170
+ export function attachWaitsOverBudget(samples, seen, budgetMs, window) {
171
+ for (const sample of samples) {
172
+ if (sample.blockingMs < budgetMs) continue;
173
+ const [from, to] = window(sample);
174
+ sample.waits = summarizeWaits(seen.filter(entry => entry.at >= from && entry.at < to));
175
+ }
176
+ }
177
+
168
178
  /** Instrument only the synchronous open call. Imports and hook setup are outside its budget.
169
179
  * These diagnostic wrappers restore every method even when open throws. */
170
180
  export async function prepareOpenTiming(runtime) {