Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@contrast/perf

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contrast/perf

Performance measurement

  • 1.2.2
  • latest
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

Perf

The perf module is intended for developers to be able to measure the performance of code.

Although the code is relatively efficient, it is not intended to be used in production code.

Design goals

The primary design goal of the perf module is that it not introduce any cost when it is not in use. Practically, this is impossible in an interpreted language, so perf is designed to have no cost after startup when it is not in use. Perf does not introduce any cost after startup if it is not enabled.

A secondary design goal is that perf is efficient enough that, if desired, it could be used in production code in order to troubleshoot a performance issue. To this end, minimal aggregation and no analysis is performed at runtime. The perf log is very simple and can be analyzed offline.

Usage

To enable perf, the environment variable CSI_PERF must be set to 1.

The logging interval can be set with the environment variable CSI_PERF_INTERVAL. The value is in milliseconds. The default is 60000, but after startup logging only occurs every 5 intervals. This is to avoid logging but should change if the request generators all complete in less than a minute.

The log is written to agent-perf.jsonl in the current working directory.

Log format

The log is one JSON object per line (JSONL).

Future

Histograms that store complex objects?

FAQs

Package last updated on 06 Nov 2024

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