@100mslive/hms-video-store
Version:
@100mslive Core SDK which abstracts the complexities of webRTC while providing a reactive store for data management with a unidirectional data flow
29 lines (28 loc) • 885 B
TypeScript
export declare type CPUPressureState = 'nominal' | 'fair' | 'serious' | 'critical';
/**
* Monitors CPU pressure using the Compute Pressure API (PressureObserver)
* and tracks the worst state observed during the session.
*/
export declare class CPUPressureMonitor {
private observer;
private worstState;
private TAG;
private readonly stateRanking;
constructor();
private init;
private updateWorstState;
/**
* Get the worst CPU pressure state observed since last reset
* Returns undefined if the API is not supported
*/
getWorstState(): CPUPressureState | undefined;
/**
* Reset the worst state back to nominal for the next monitoring window
* Call this after sending analytics to track worst state per window
*/
resetWorstState(): void;
/**
* Stop monitoring and clean up
*/
stop(): void;
}