Class Profiler<T>
Type parameters
Hierarchy
- 
						Service<T>
						
- Profiler
 
 
Constructors
Properties
Methods
Constructors
- 
							
							
Parameters
- 
									
webda: Core
The main instance of Webda
 - 
									
name: string
The name of the service
 - 
									
Optional params: any
The parameters block define in the configuration file
 
Returns Profiler
 - 
									
 
Properties
Service name
Webda Core object
Logger with class context
Hold the parameters for your service
It will be bring from the webda.config.json
Methods
- 
							
							
Clean the service data, can only be used in test mode
Returns Promise<any>
 
- 
							
							
Parameters
- 
									
event: string | symbol
 - 
									
listener: function
- 
											
- 
													
Parameters
- 
															
Rest ...args: any[]
 
Returns void
 - 
															
 
 - 
													
 
 - 
											
 
Returns this
 - 
									
 
- 
							
							
Add a route dynamicaly
Parameters
- 
									
url: string
of the route can contains dynamic part like {uuid}
 - 
									
methods: HttpMethodType[]
 - 
									
executer: Function
Method to execute for this route
 - 
									
Optional openapi: object
 - 
									
Optional allowPath: boolean
 
Returns void
 - 
									
 
- 
							
							
Used to compute or derivate input parameter to attribute
Returns void
 
- 
							
							
Parameters
- 
									
event: string | symbol
 - 
									
Rest ...args: any[]
 
Returns boolean
 - 
									
 
- 
							
							
Emit the event with data and wait for Promise to finish if listener returned a Promise
Parameters
- 
									
event: any
 - 
									
data: any
 
Returns Promise<any[]>
 - 
									
 
- 
							
							
Returns Array<string | symbol>
 
- 
							
							
Return true if the service should not be instrumentalized Logger service are excluded
Parameters
- 
									
service: Service
to check
 
Returns boolean
 - 
									
 
- 
							
							
Returns number
 
- 
							
							
Return all methods from an object
Parameters
- 
									
obj: any
to return methods from
 
Returns any[]
 - 
									
 
- 
							
							
Get service name
Returns string
 
- 
							
							
Get the service parameters
Returns T
 
- 
							
							
Return a webda service
Type parameters
- 
									
T: Service<ServiceParameters>
 
Parameters
- 
									
service: string
name to retrieve
 
Returns T
 - 
									
 
- 
							
							
Return WebdaCore
Returns Core
 
- 
							
							
Will be called after all the Services are created
Returns Promise<void>
 
- 
							
							
Init the routes
Returns void
 
- 
							
							
Instrument Request to display request duration in ms
Parameters
- 
									
ctx: Context
 - 
									
Rest ...args: any[]
 
Returns void
 - 
									
 
- 
							
							
Return if Profiler is enable
Returns boolean
 
- 
							
							
Parameters
- 
									
type: string | symbol
 
Returns number
 - 
									
 
- 
							
							
Parameters
- 
									
event: string | symbol
 
Returns Function[]
 - 
									
 
- 
							
							
Load the parameters for a service
Parameters
- 
									
params: any
 
Returns ServiceParameters
 - 
									
 
- 
							
							
Parameters
- 
									
level: WorkerLogLevel
to log
 - 
									
Rest ...args: any[]
 
Returns void
 - 
									
 
- 
							
							
Log the performance
Parameters
- 
									
Rest ...args: any[]
 
Returns void
 - 
									
 
- 
							
							
Parameters
- 
									
event: string | symbol
 - 
									
listener: function
- 
											
- 
													
Parameters
- 
															
Rest ...args: any[]
 
Returns void
 - 
															
 
 - 
													
 
 - 
											
 
Returns this
 - 
									
 
- 
							
							
Parameters
- 
									
event: string | symbol
 - 
									
listener: function
- 
											
- 
													
Parameters
- 
															
Rest ...args: any[]
 
Returns void
 - 
															
 
 - 
													
 
 - 
											
 
Returns this
 - 
									
 
- 
							
							
Listen to an event as on(...) would do except that it will be asynchronous
Parameters
- 
									
event: any
 - 
									
callback: any
 - 
									
Optional queue: string
Name of queue to use, can be undefined, queue name are used to define differents priorities
 
Returns void
 - 
									
 
- 
							
							
Parameters
- 
									
event: string | symbol
 - 
									
listener: function
- 
											
- 
													
Parameters
- 
															
Rest ...args: any[]
 
Returns void
 - 
															
 
 - 
													
 
 - 
											
 
Returns this
 - 
									
 
- 
							
							
Patch all services method: interlacing our pre/post processor
Parameters
- 
									
services: any
 
Returns 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
 - 
									
 
- 
							
							
Parameters
- 
									
event: string | symbol
 - 
									
listener: function
- 
											
- 
													
Parameters
- 
															
Rest ...args: any[]
 
Returns void
 - 
															
 
 - 
													
 
 - 
											
 
Returns this
 - 
									
 
- 
							
							
Parameters
- 
									
event: string | symbol
 - 
									
listener: function
- 
											
- 
													
Parameters
- 
															
Rest ...args: any[]
 
Returns void
 - 
															
 
 - 
													
 
 - 
											
 
Returns this
 - 
									
 
- 
							
							
Method to call before original function
Parameters
- 
									
service: Service
being patched
 - 
									
method: string
method being patch
 
Returns object
- 
									
start: number
 
 - 
									
 
- 
							
							
Parameters
- 
									
event: string | symbol
 
Returns Function[]
 - 
									
 
- 
							
							
Parameters
- 
									
config: any
new parameters for the service
 
Returns Promise<void>
 - 
									
 
- 
							
							
Parameters
- 
									
Optional event: string | symbol
 
Returns this
 - 
									
 
- 
							
							
Parameters
- 
									
event: string | symbol
 - 
									
listener: function
- 
											
- 
													
Parameters
- 
															
Rest ...args: any[]
 
Returns void
 - 
															
 
 - 
													
 
 - 
											
 
Returns this
 - 
									
 
- 
							
							
Add listeners on
Webda.Init.ServicesandWebda.RequestReturns void
 
- 
							
							
Parameters
- 
									
n: number
 
Returns this
 - 
									
 
- 
							
							
Convert an object to JSON using the Webda json filter
Parameters
- 
									
object: any
The object to export
 
Returns string
The export of the strip object ( removed all attribute with _ )
 - 
									
 
- 
							
							
							
Returns ModdaDefinition
 
- 
							
							
							
Parameters
- 
									
emitter: EventEmitter
 - 
									
event: string | symbol
 
Returns number
 - 
									
 
Generated using TypeDoc
Profiling service
Mesure timing of each method and display them in TRACE