Project

p99-ruby

0.0
The project is in a healthy, maintained state
Low-cost generation of performance percentiles (p50, p90, p99, p99.9, etc.), for Ruby. p99.Ruby is the Ruby implementation of the p99 family of libraries. This release provides a pure-Ruby Histogram; a C-extension backend is planned.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

>= 0.39.10, < 1
 Project Readme

p99.Ruby

Low-cost generation of performance percentiles (p50, p90, p99, p99.9, etc.), for Ruby

Language License GitHub release Last Commit Gem Version Ruby

Table of Contents

  • Introduction
  • Installation
  • Components
    • P99::Histogram
  • Examples
  • Project Information
    • Where to get help
    • Contribution guidelines
    • Dependencies
      • Development Dependencies
    • Related projects
    • License

Introduction

p99 is a lightweight, low-overhead library designed for generating real-time performance percentiles in high-frequency or latency-sensitive environments.

p99.Ruby is the Ruby implementation.

Installation

Install via gem as in:

gem install p99-ruby

or add it to your Gemfile.

Use via require, as in:

require 'p99'

Components

P99::Histogram

Low-cost, fixed-size histogram for recording event durations (nanoseconds and common larger units) and querying high-resolution percentiles (p50, p90, p99, and beyond).

This release provides a pure-Ruby implementation. A C-extension backend (with automatic fallback) is planned.

See the Histogram component guide for loading, recording, statistics, percentile, and backend details. The generated API reference provides the complete source-level method documentation.

The task-oriented guides provide practical workflows for recording and reading percentiles.

require 'p99'

h = P99::Histogram.new
h.push_event_time_ns(150)
h.push_event_time_us(5)
h.push_event_time_ms(10)

h.event_count          # => 3
h.value_at_p99         # => approximated duration in nanoseconds
P99::IMPLEMENTATION    # => "ruby" (or "c" when a native backend is present)

Force the pure-Ruby backend (for debugging or CI):

P99_PURE_RUBY=1 ruby -e "require 'p99'; puts P99::IMPLEMENTATION"

Examples

See EXAMPLES.md for the full list. The primary demonstration is build_histogram:

ruby examples/build_histogram.rb
P99_TRIES=1000 ruby examples/build_histogram.rb

Project Information

Where to get help

GitHub Page

Contribution guidelines

Defect reports, feature requests, and pull requests are welcome on https://github.com/synesissoftware/p99.Ruby.

Dependencies

  • <none>

Development Dependencies

Related projects

License

p99.Ruby is released under the 3-clause BSD license. See LICENSE for details.