1.0.0 • Published 4 years ago

@asayerio/tracker-profiler v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

Asayer Tracker profiler plugin

The profiler plugin allows you to measure 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.plugin(trackerProfiler());

const fn = profiler('call_name')(() => {
  // ...
}, thisArg); // thisArg is optional