Profiler

The profiler plugin allows you to measure JS function performance and capture the arguments and result for each function call.

Installation

npm i @asayerio/tracker-profiler --save

Usage

Initialize the @asayerio/tracker package as usual and load the plugin into it. Then decorate any function inside your code with the generated function.

import Tracker from '@asayerio/tracker';
import trackerProfiler from '@asayerio/tracker-profiler';
const tracker = new Tracker({
projectID: PROJECT_ID,
});
tracker.start();
export const profiler = tracker.use(trackerProfiler());
const fn = profiler('call_name')(() => {
// ...
}, thisArg); // thisArg is optional