playwright-performance-reporter
Version:
Measure and publish performance metrics from browser dev-tools when running playwright
41 lines (40 loc) • 1.31 kB
TypeScript
import type CDP from 'chrome-remote-interface';
import { type Metric, type MetricObserver } from '../../../types/index.js';
export declare class HeapDump implements MetricObserver {
readonly name = "heapDump";
readonly plugins: import("../../../types/performance.js").MeasurePlugin[];
/**
* Options to call `HeapProfiler.takeHeapSnapshot` which are mandatory to collect
*
* @private
*/
private readonly takeHeapSnapshotOptions;
/**
* @inheritdoc
*/
onStart(accumulator: Metric, developmentTools: CDP.Client): Promise<void>;
/**
* @inheritdoc
*/
onSampling(accumulator: Metric, developmentTools: CDP.Client): Promise<void>;
/**
* @inheritdoc
*/
onStop(accumulator: Metric, developmentTools: CDP.Client): Promise<void>;
/**
* Common function for onStart and onStop hook
*/
private common;
/**
* Wrapper for `HeapProfiler.takeHeapSnapshot` and check if request was successful
*/
private takeHeapSnapshot;
/**
* Wrapper for `HeapProfiler.addHeapSnapshotChunk` and report response continuously
*/
private listenForNextChunk;
/**
* Wrapper for `HeapProfiler.reportHeapSnapshotProgress` and report response continuously
*/
private waitForHeapDumpCompletion;
}