coverband  by danmayer

Ruby gem for production code coverage

created 11 years ago
2,578 stars

Top 18.6% on sourcepulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

Coverband is a Ruby gem designed to collect and report on production code usage, providing line-by-line execution counts for Ruby applications. It targets developers and operations teams seeking to understand runtime behavior, identify unused code, and optimize performance in production environments. The primary benefit is gaining actionable insights into code execution with minimal performance impact.

How It Works

Coverband operates by patching Ruby's Kernel#require and Kernel#load to track code execution. It stores coverage data in Redis, either through a background thread or as Rack middleware. This approach allows for continuous monitoring with low overhead, distinguishing between code loaded during application startup (eager load) and code executed during runtime.

Quick Start & Requirements

  • Install via Bundler: gem 'coverband'
  • Requires Redis for data storage.
  • Official Demo App: https://coverband.io/

Highlighted Details

  • Reports runtime code usage, not just test coverage.
  • Features a mountable web UI for visualizing coverage data.
  • Supports Rails, Sinatra, and non-Rack Ruby applications.
  • Offers configuration for ignoring files, tracking routes, and managing reporting frequency.

Maintenance & Community

The project is actively maintained, with contributions from various developers. Community support channels are not explicitly mentioned, but the project has a GitHub repository for issues and contributions.

Licensing & Compatibility

  • License: MIT
  • Compatible with commercial use and closed-source applications.

Limitations & Caveats

Coverband does not provide line-level coverage for view files (e.g., ERB, Slim), only file-level tracking. It is incompatible with Scout APM's auto-instrumentation (AUTO_INSTRUMENT=true) and Bootsnap, as these interfere with its patching mechanisms. Elastic APM requires careful gem loading order to avoid conflicts.

Health Check
Last commit

3 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
24 stars in the last 90 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), Sourabh Bajaj Sourabh Bajaj(Cofounder of Uplimit), and
4 more.

opik by comet-ml

2.5%
12k
Open-source LLM evaluation framework for RAG, agents, and more
created 2 years ago
updated 1 day ago
Feedback? Help us improve.