@univerjs/engine-render v0.5.4


Class: PerformanceMonitor

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/performance-monitor.ts:52

Performance monitor tracks rolling average frame-time and frame-time variance over a user defined sliding-window

Extends

Constructors

new PerformanceMonitor()

new PerformanceMonitor(frameSampleSize): PerformanceMonitor

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/performance-monitor.ts:76

Parameters

ParameterTypeDefault valueDescription
frameSampleSizenumberDEFAULT_FRAME_SAMPLE_SIZEThe number of samples required to saturate the sliding window

Returns

PerformanceMonitor

Overrides

Disposable.constructor

Properties

PropertyModifierTypeDefault valueInherited fromDefined in
_disposedprotectedbooleanfalseDisposable._disposedpackages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/lifecycle.ts:96

Accessors

averageFPS

Get Signature

get averageFPS(): number

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/performance-monitor.ts:109

Returns the average framerate in frames per second over the sliding window (or the subset of frames sampled so far)

Returns

number


averageFrameTime

Get Signature

get averageFrameTime(): number

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/performance-monitor.ts:88

Returns the average frame time in milliseconds of the sliding window (or the subset of frames sampled so far)

Returns

number


averageFrameTimeVariance

Get Signature

get averageFrameTimeVariance(): number

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/performance-monitor.ts:95

Returns the variance frame time in milliseconds over the sliding window (or the subset of frames sampled so far)

Returns

number


instantaneousFPS

Get Signature

get instantaneousFPS(): number

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/performance-monitor.ts:116

Returns the average framerate in frames per second using the most recent frame time

Returns

number


instantaneousFrameTime

Get Signature

get instantaneousFrameTime(): number

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/performance-monitor.ts:102

Returns the frame time of the last recent frame.

Returns

number


isEnabled

Get Signature

get isEnabled(): boolean

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/performance-monitor.ts:136

Returns true if sampling is enabled

Returns

boolean


isSaturated

Get Signature

get isSaturated(): boolean

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/performance-monitor.ts:129

Returns true if enough samples have been taken to completely fill the sliding window

Returns

boolean

Methods

disable()

disable(): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/performance-monitor.ts:200

Disables contributions to the sliding window sample set Samples will not be interpolated over the disabled period

Returns

void


dispose()

dispose(): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/performance-monitor.ts:81

Returns

void

Overrides

Disposable.dispose


disposeWithMe()

disposeWithMe(disposable): IDisposable

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/lifecycle.ts:99

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

Disposable.disposeWithMe


enable()

enable(): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/performance-monitor.ts:192

Enables contributions to the sliding window sample set

Returns

void


endFrame()

endFrame(timestamp): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/performance-monitor.ts:176

Parameters

ParameterType
timestampnumber

Returns

void


ensureNotDisposed()

protected ensureNotDisposed(): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/lifecycle.ts:103

Returns

void

Inherited from

Disposable.ensureNotDisposed


now()

now(): number

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/performance-monitor.ts:181

Returns

number


reset()

reset(): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/performance-monitor.ts:209

Resets performance monitor

Returns

void


sampleFrame()

sampleFrame(timestamp): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/performance-monitor.ts:145

Samples current frame, set averageFPS instantaneousFrameTime this method is called each frame by engine renderLoop —> endFrame.

Parameters

ParameterTypeDescription
timestampnumberA timestamp in milliseconds of the current frame to compare with other frames

Returns

void