@onerepo/plugin-performance-writer
This is a usable example plugin to demonstrate how to build your own telemetry and performance tracing plugin using the oneRepo plugin API and internal performance entries.
Using a PerformanceObserver, it listens for performance marks and converts them into measurements from onerepo_start_
to onerepo_end_
prefixed entries. On CLI shutdown, the measurements will be written to a file for later operation.
Installation
Section titled InstallationConfiguration
Section titled ConfigurationperformanceWriter()
Section titled performanceWriter()Include the performanceWriter
plugin in your oneRepo plugin setup:
Parameters
Section titled ParametersParameter | Type |
---|---|
opts | Options |
Options
Section titled OptionsInclude the performanceWriter
plugin in your oneRepo plugin setup:
Type declaration
Section titled Type declarationoutput?
Section titled output?Whether or not to measure performance marks. Adds minimal overhead. Disable if you’d prefer to make your own measurements.
temp
: Writes a JSON dump of the measurement entries to a temporary file. The filepath will be returned from therun()
call of your application.string
: Will do the same as'temp'
, but use this string as the filepath.- Default:
true