Module: ko/profiler

Profile javascript code

This produces profiler logs that are compatible with Cleopatra

Methods


require("ko/profiler").disable()

Disable profiling, does not stop already active profilers

Returns:
Type
Void

require("ko/profiler").enable()

Enable profiling, none of the other methods in this module will do anything otherwise

Returns:
Type
Void

require("ko/profiler").isActive()

Check whether a profiler is running

Returns:
Type
Boolean

require("ko/profiler").pause(name)

Pause profiling

Parameters:
Name Type Description
name String
Returns:
Type
Void

require("ko/profiler").resume(name)

Resume profiling

Parameters:
Name Type Description
name String
Returns:
Type
Void

require("ko/profiler").save(name)

Save the log, this should be called before calling stop()

Logs are saved to profiledir/profiler

Parameters:
Name Type Description
name String
Returns:
Type
Void

require("ko/profiler").start(name)

Start profiling

If a name is given it will only run if the "profilerEnabledName" is set to the same name.

The named profilers are mainly intended for profiling code that runs on startup, for anything else you should just call start() without a name.

Parameters:
Name Type Description
name String

name of profiler (optional)

Returns:
Type
Void

require("ko/profiler").stop(name)

Stop profiling

Parameters:
Name Type Description
name String
Returns:
Type
Void