npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@polarsignals/custom-labels-debug-test

v0.2.0

Published

test

Readme

Warning

This library is experimental; both the API and ABI are subject to change.

Description

This library maintains a thread-local mapping of keys to values. Each key and value is an arbitrary byte array.

The core goal of the design is that the map for a thread may be validly read from that thread whenever user code is stopped; for example, in a signal handler, a debugger, or an eBPF program. This should work even if the thread happens to be suspended in the middle of one of the functions of this library.

The intended purpose is to store custom labels for annotating stack traces during profiling; for example, client code might set the label customer_id whenever it is processing a request for a particular customer, and a CPU profiler might then record that value whenever it interrupts the program to collect a stack trace.

The library exposes a C API (in customlabels.h), a Rust API documented here, and an ABI for reading by external code (e.g., profilers or debuggers).

Supported Configurations

Language: any language that can link against C code.

Platform: Linux on x86-64 or aarch64 (64-bit ARM).

Using from Rust

Depend on the custom-labels crate as both a standard dependency and a build dependency. For example, in your Cargo.toml:

[dependencies]
custom-labels = "0.4"

[build-dependencies]
custom-labels = "0.4"

Then add the following line to your executable's build.rs:

#[cfg(not(target_os="macos"))]
custom_labels::build::emit_build_instructions();

Using from C or C++ (shared library)

For a release build:

CFLAGS="-O2" make

For a debug build:

CFLAGS="-O0 -g" make

Either will produce a library called libcustomlabels.so in the repository root, which should be linked against during your build process.

Using from C or C++ (main executable)

Ensure that customlabels.c is linked into your executable and that customlabels.h is available in the include path for any source file from which you want to use custom labels. The details of this will depend on your build system.

ABI

For profiler authors, the ABI is v1 of the Custom Labels ABI described here.

Acknowledgements

  • The approach was partially influenced by the APM/universal profiling integration described here.