Skip to content 

PerformanceEvent Class

Packages > @fluidframework/telemetry-utils > PerformanceEvent

Helper class to log performance events

Signature:

export declare class PerformanceEvent 

Constructors

List of constructors for this class
Constructor Modifiers Description
(constructor)(logger, event) Constructs a new instance of the PerformanceEvent class

Methods

List of methods on this class
Method Modifiers Description
cancel(props, error)
end(props, eventNameSuffix)
reportEvent(eventNameSuffix, props, error)
reportProgress(props, eventNameSuffix)
start(logger, event) static
timedExec(logger, event, callback) static
timedExecAsync(logger, event, callback) static

Constructors

PerformanceEvent.(constructor)

Constructs a new instance of the PerformanceEvent class

Signature:

protected constructor(logger: ITelemetryLogger, event: ITelemetryGenericEvent);

Parameters

List of parameters
Parameter Type Description
logger ITelemetryLogger
event ITelemetryGenericEvent

Methods

cancel

Signature:

cancel(props?: ITelemetryProperties, error?: any): void;

Parameters

List of parameters
Parameter Type Description
props ITelemetryProperties
error any

Returns:

void

end

Signature:

end(props?: ITelemetryProperties, eventNameSuffix?: string): void;

Parameters

List of parameters
Parameter Type Description
props ITelemetryProperties
eventNameSuffix string

Returns:

void

reportEvent

Signature:

reportEvent(eventNameSuffix: string, props?: ITelemetryProperties, error?: any): void;

Parameters

List of parameters
Parameter Type Description
eventNameSuffix string
props ITelemetryProperties
error any

Returns:

void

reportProgress

Signature:

reportProgress(props?: ITelemetryProperties, eventNameSuffix?: string): void;

Parameters

List of parameters
Parameter Type Description
props ITelemetryProperties
eventNameSuffix string

Returns:

void

start

Signature:

static start(logger: ITelemetryLogger, event: ITelemetryGenericEvent): PerformanceEvent;

Parameters

List of parameters
Parameter Type Description
logger ITelemetryLogger
event ITelemetryGenericEvent

Returns:

PerformanceEvent

timedExec

Signature:

static timedExec<T>(logger: ITelemetryLogger, event: ITelemetryGenericEvent, callback: (event: PerformanceEvent) => T): T;

Parameters

List of parameters
Parameter Type Description
logger ITelemetryLogger
event ITelemetryGenericEvent
callback (event: PerformanceEvent) => T

Returns:

T

timedExecAsync

Signature:

static timedExecAsync<T>(logger: ITelemetryLogger, event: ITelemetryGenericEvent, callback: (event: PerformanceEvent) => Promise<T>): Promise<T>;

Parameters

List of parameters
Parameter Type Description
logger ITelemetryLogger
event ITelemetryGenericEvent
callback (event: PerformanceEvent) => Promise

Returns:

Promise<T>