Socket
Socket
Sign inDemoInstall

trace-event-lib

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trace-event-lib

A library to create a trace of your JS app per Google's Trace Event format.


Version published
Weekly downloads
167K
decreased by-17.62%
Maintainers
1
Weekly downloads
 
Created
Source

trace-event-lib

npm version CI semantic-release: angular Commitizen friendly

A library to create a trace of your JS app per Google's Trace Event format.

chrome://tracing example

These logs can then be visualized with:

Install

npm install trace-event-lib --save

Usage

import { AbstractEventBuilder } from 'chrome-trace-event';

class ConcreteEventBuilder extends AbstractEventBuilder {
    send(event) {
        // Implement the abstract method: push events into a stream, array, etc.
    }
}

const trace = new ConcreteEventBuilder();

trace.begin({ cat: 'category1,category2', name: 'duration event' });
// ...
trace.instant({ name: 'resolve config', args: { /* ... */ } });
// ...
trace.complete({ name: 'nested event', dur: 3e6 /* 3s */ });
// ...
trace.end();

/**
 * Also, see the other methods on the website.
 *
 * @see {@link AbstractEventBuilder#beginAsync}
 * @see {@link AbstractEventBuilder#instantAsync}
 * @see {@link AbstractEventBuilder#endAsync}
 * @see {@link AbstractEventBuilder#counter}
 * @see {@link AbstractEventBuilder#metadata}
 * @see {@link AbstractEventBuilder#process_name}
 * @see {@link AbstractEventBuilder#process_labels}
 * @see {@link AbstractEventBuilder#process_sort_index}
 * @see {@link AbstractEventBuilder#thread_name}
 * @see {@link AbstractEventBuilder#thread_sort_index}
 */

License

MIT License

Keywords

FAQs

Package last updated on 06 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc