42 releases (27 breaking)

0.27.0 Nov 5, 2024
0.25.0 Sep 5, 2024
0.24.0 Jul 29, 2024
0.19.1 Feb 26, 2024
0.2.1 Feb 23, 2018

#34 in Profiling

Download history 16/week @ 2024-08-16 11/week @ 2024-08-23 137/week @ 2024-08-30 59/week @ 2024-09-06 50/week @ 2024-09-13 50/week @ 2024-09-20 31/week @ 2024-09-27 28/week @ 2024-10-04 13/week @ 2024-10-11 8/week @ 2024-10-18 109/week @ 2024-10-25 166/week @ 2024-11-01 35/week @ 2024-11-08 17/week @ 2024-11-15 12/week @ 2024-11-22 6/week @ 2024-11-29

92 downloads per month

MIT license

9MB
225K SLoC

rbspy

crates.io ci

Have a running Ruby program that you want to profile without restarting it? Want to profile a Ruby command line program really easily? You want rbspy! rbspy can profile any Ruby program just by running 1 simple command.

rbspy lets you profile Ruby processes that are already running. You give it a PID, and it starts profiling. It's a sampling profiler, which means it's low overhead and safe to run in production.

rbspy lets you record profiling data, save the raw profiling data to disk, and then analyze it in a variety of different ways later on.

only wall-clock profiling

There are 2 main ways to profile code -- you can either profile everything the application does (including waiting), or only profile when the application is using the CPU.

rbspy profiles everything the program does (including waiting) -- there's no option to just profile when the program is using the CPU.

Documentation

=> https://rbspy.github.io

Requirements

rbspy supports Linux*, Mac, Windows, and FreeBSD.

* kernel version 3.2+ required. For Ubuntu, this means Ubuntu 12.04 or newer.

Add a testimonial

Did rbspy help you make your program faster? An awesome way to thank the project is to add a success story to this GitHub issue where people talk about ways rbspy has helped them! Hearing that rbspy is working for people is good motivation :)

Installing

Standalone binary

On Mac, you can install with Homebrew: brew install rbspy.

On Linux:

  1. Download recent release of rbspy from the GitHub releases page.
    • The binaries tagged with musl are statically linked against musl libc and can be used on most systems. The ones tagged with gnu are dynamically linked against GNU libc, so you will need it to be installed.
  2. Unpack it
  3. Move the rbspy binary to /usr/local/bin

Or have a look at Installing rbspy on our documentation.

As a Rust library

To use rbspy in your Rust project, add the following to your Cargo.toml:

[dependencies]
rbspy = "0.8"

WARNING: The rbspy crate's API is not stable yet. We will follow semantic versioning after rbspy reaches version 1.0.

Contributing

Pull requests that improve usability, fix bugs, or help rbspy support more operating systems are very welcome. If you have a question, the best way to ask is to create a GitHub issue!

If you're not a very experienced Rust programmer, you're very welcome to contribute. A major reason rbspy is written in Rust is that Rust is more approachable for beginners than C/C++. https://www.rust-lang.org/ has great resources for learning Rust.

Building rbspy

  1. Install cargo from crates.io
  2. cargo build to build
  3. cargo test to test

The built binary will end up at target/debug/rbspy

Dependencies

~13–25MB
~398K SLoC