Skip to content
WIP: OpenProfiling is a toolkit for collecting profiling data from production workload safely.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/ISSUE_TEMPLATE
examples
packages
.drone.yml
.gitignore
.npmignore
CONTRIBUTING.md
LICENSE
README.md
lerna.json
package.json
yarn.lock

README.md

Version Build Status codecov License

OpenProfiling is a toolkit for collecting profiling data from production workload safely.

The project's goal is to empower developers to understand how they applications is behaving in production with minimal performance impact and without vendor lock-in.

The library is in alpha stage and the API is subject to change.

I expect that the library will not match everyone use-cases, so i'm asking to everyone in this case to open an issue so we can discuss how the toolkit could meet yours.

Installation

Install OpenProfiling for NodeJS with:

yarn add @openprofiling/nodejs

or

npm install @openprofiling/nodejs

Configure

Before running your application with @openprofiling/nodejs, you will need choose 3 different things:

  • What do you want to profile: an profiler
  • How to start this profiler: an trigger
  • Where to send the profiling data: an exporter

Then, the API is pretty straigthforward (example are in typescript):

import { ProfilingAgent } from '@openprofiling/nodejs'
import { FileExporter } from '@openprofiling/exporter-file'
import { InspectorHeapProfiler } from '@openprofiling/inspector-heap-profiler'
import { InspectorCPUProfiler } from '@openprofiling/inspector-cpu-profiler'
import { SignalTrigger } from '@openprofiling/trigger-signal'

const profilingAgent = new ProfilingAgent()
/**
 * Register a profiler for a specific trigger
 * ex: we want to collect cpu profile when the application receive a SIGUSR2 signal
 */
profilingAgent.register(new SignalTrigger({ signal: 'SIGUSR2' }), new InspectorCPUProfiler())
/**
 * Start the agent (which will tell the trigger to start listening) and
 * configure where to output the profiling data
 * ex: the file exporter will output on the disk, by default in /tmp
 */
profilingAgent.start({ exporter: new FileExporter() })

Triggers

A trigger is simply a way to start collecting data, you can choose between those:

Profilers

Profilers are the implementation that collect profiling data from different sources, current available profilers:

Exporters

OpenProfiling aim to be vendor-neutral and can push profiling data to any backend with different exporter implementations. Currently, it supports:

Versioning

This library follows Semantic Versioning.

Note that before the 1.0.0 release, any minor update can have breaking changes.

LICENSE

Apache License 2.0

You can’t perform that action at this time.