Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Profiler<T>

Profiling service

Mesure timing of each method and display them in TRACE

Type parameters

Hierarchy

Constructors

  • new Profiler(webda: Core, name: string, params?: any): Profiler

Properties

_createException: string
_initException: any
_initTime: number
_name: string

Service name

_webda: Core

Webda Core object

logger: Logger

Logger with class context

parameters: T

Hold the parameters for your service

It will be bring from the webda.config.json

defaultMaxListeners: number

Methods

  • __clean(): Promise<any>
  • addListener(event: string | symbol, listener: function): this
  • addRoute(url: string, methods: HttpMethodType[], executer: Function, openapi?: object, allowPath?: boolean): void
  • computeParameters(): void
  • emit(event: string | symbol, ...args: any[]): boolean
  • emitSync(event: any, data: any): Promise<any[]>
  • eventNames(): Array<string | symbol>
  • excludeService(service: Service): boolean
  • getMaxListeners(): number
  • getMethods(obj: any): any[]
  • getName(): string
  • getParameters(): T
  • getService<T>(service: string): T
  • getWebda(): Core
  • init(): Promise<void>
  • initRoutes(): void
  • instrumentRequest(ctx: Context, ...args: any[]): void
  • isEnabled(): boolean
  • listenerCount(type: string | symbol): number
  • listeners(event: string | symbol): Function[]
  • loadParameters(params: any): ServiceParameters
  • logMetrics(...args: any[]): void
  • off(event: string | symbol, listener: function): this
  • on(event: string | symbol, listener: function): this
  • onAsync(event: any, callback: any, queue?: string): void
  • once(event: string | symbol, listener: function): this
  • patchServices(services: any): void
  • postprocessor(service: Service, method: string, data?: any, err?: any): void
  • Method to call after original function

    Parameters

    • service: Service

      being patched

    • method: string

      method being patch

    • Optional data: any

      return by the preprocessor

    • Optional err: any

      error thrown by the method if any

    Returns void

  • prependListener(event: string | symbol, listener: function): this
  • prependOnceListener(event: string | symbol, listener: function): this
  • preprocessor(service: Service, method: string): object
  • rawListeners(event: string | symbol): Function[]
  • reinit(config: any): Promise<void>
  • removeAllListeners(event?: string | symbol): this
  • removeListener(event: string | symbol, listener: function): this
  • resolve(): void
  • setMaxListeners(n: number): this
  • toPublicJSON(object: any): string
  • getModda(): ModdaDefinition
  • listenerCount(emitter: EventEmitter, event: string | symbol): number

Generated using TypeDoc