You're viewing archived documentation for @imqueue/core v2.0.26. APIs may differ from the current release. View the latest version ↗

profile() function

Implements '@profile' decorator.

Signature:

export declare function profile(options?: ProfileDecoratorOptions): (target: any, methodName: string, descriptor: TypedPropertyDescriptor<(...args: any[]) => any>) => void;

Parameters

Parameter

Type

Description

options

ProfileDecoratorOptions

(Optional)

Returns:

(target: any, methodName: string, descriptor: TypedPropertyDescriptor<(...args: any[]) => any>) => void

Example

~~~typescript import { profile } from '@imqueue/core';

class MyClass {

@profile(true) // forced profiling public myMethod()

@profile() // profiling happened only depending on env DEBUG flag private innerMethod() { // ... } } ~~~

{( target: any, methodName: (string), descriptor: TypedPropertyDescriptor<(...args: any[]) => any> ) => void}