Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace trackers

Provides event, error, and performance logging for applications.

// esm
import { trackers } from '@paychex/core';

// cjs
const { trackers } = require('@paychex/core');

// iife
const { trackers } = window['@paychex/core'];

// amd
require(['@paychex/core'], function({ trackers }) { ... });
define(['@paychex/core'], function({ trackers }) { ... });
example
export const tracker = trackers.create(console.log);

export async function bootstrap(appId) {
const child = tracker.child();
try {
child.context({ app: appId });
const stop = child.start('bootstrap time');
const scripts = await loadScripts();
child.event('app bootstrapped');
stop({
tags: ['perf', 'ct-003'],
scriptCount: scripts.length
});
} catch (e) {
child.error(e);
}
}

Index

Type aliases

NestedStartResult: [TimerStopFunction, NestedStart]

Array of functions returned by calling start on a NestedTimingTracker instance. The first function stops the current timer. The second function starts a new nested timer.

Functions

  • Creates a new Tracker instance. The specified subscriber will be notified when new TrackingInfo entries are created.

    example
    const tracker = trackers.create((info) => {
    console.log(JSON.stringify(info));
    });

    Parameters

    Returns Tracker

    The new Tracker instance.