API Reference
@univerjs
@univerjs/engine-render
classes
Performancemonitor

@univerjs/engine-render v0.4.2Docs


Class: PerformanceMonitor

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

Parameters

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

Returns

PerformanceMonitor

Overrides

Disposable.constructor

Defined in

submodules/univer/packages/engine-render/src/basics/performance-monitor.ts:76 (opens in a new tab)

Properties

PropertyModifierTypeDefault valueInherited fromDefined in
_disposedprotectedbooleanfalseDisposable._disposedsubmodules/univer/packages/core/src/shared/lifecycle.ts:93 (opens in a new tab)

Accessors

averageFPS

get averageFPS(): number

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

Returns

number

Defined in

submodules/univer/packages/engine-render/src/basics/performance-monitor.ts:109 (opens in a new tab)


averageFrameTime

get averageFrameTime(): number

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

Returns

number

Defined in

submodules/univer/packages/engine-render/src/basics/performance-monitor.ts:88 (opens in a new tab)


averageFrameTimeVariance

get averageFrameTimeVariance(): number

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

Returns

number

Defined in

submodules/univer/packages/engine-render/src/basics/performance-monitor.ts:95 (opens in a new tab)


instantaneousFPS

get instantaneousFPS(): number

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

Returns

number

Defined in

submodules/univer/packages/engine-render/src/basics/performance-monitor.ts:116 (opens in a new tab)


instantaneousFrameTime

get instantaneousFrameTime(): number

Returns the frame time of the last recent frame.

Returns

number

Defined in

submodules/univer/packages/engine-render/src/basics/performance-monitor.ts:102 (opens in a new tab)


isEnabled

get isEnabled(): boolean

Returns true if sampling is enabled

Returns

boolean

Defined in

submodules/univer/packages/engine-render/src/basics/performance-monitor.ts:136 (opens in a new tab)


isSaturated

get isSaturated(): boolean

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

Returns

boolean

Defined in

submodules/univer/packages/engine-render/src/basics/performance-monitor.ts:129 (opens in a new tab)

Methods

disable()

disable(): void

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

Returns

void

Defined in

submodules/univer/packages/engine-render/src/basics/performance-monitor.ts:200 (opens in a new tab)


dispose()

dispose(): void

Returns

void

Overrides

Disposable.dispose

Defined in

submodules/univer/packages/engine-render/src/basics/performance-monitor.ts:81 (opens in a new tab)


disposeWithMe()

disposeWithMe(disposable): IDisposable

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

Disposable.disposeWithMe

Defined in

submodules/univer/packages/core/src/shared/lifecycle.ts:96 (opens in a new tab)


enable()

enable(): void

Enables contributions to the sliding window sample set

Returns

void

Defined in

submodules/univer/packages/engine-render/src/basics/performance-monitor.ts:192 (opens in a new tab)


endFrame()

endFrame(timestamp): void

Parameters

ParameterType
timestampnumber

Returns

void

Defined in

submodules/univer/packages/engine-render/src/basics/performance-monitor.ts:176 (opens in a new tab)


ensureNotDisposed()

protected ensureNotDisposed(): void

Returns

void

Inherited from

Disposable.ensureNotDisposed

Defined in

submodules/univer/packages/core/src/shared/lifecycle.ts:100 (opens in a new tab)


now()

now(): number

Returns

number

Defined in

submodules/univer/packages/engine-render/src/basics/performance-monitor.ts:181 (opens in a new tab)


reset()

reset(): void

Resets performance monitor

Returns

void

Defined in

submodules/univer/packages/engine-render/src/basics/performance-monitor.ts:209 (opens in a new tab)


sampleFrame()

sampleFrame(timestamp): void

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

Defined in

submodules/univer/packages/engine-render/src/basics/performance-monitor.ts:145 (opens in a new tab)


Copyright © 2021-2024 DreamNum Co,Ltd. All Rights Reserved.