No commit activity in last 3 years
No release in over 3 years
Format and print the result of rblineprof (github.com/tmm1/rblineprof)
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

 Project Readme

rblineprof-report

A simple utility to format and print the result of rblineprof. Makes line-by-line source code profiling easy.

Installation

Add this line to your application's Gemfile:

gem 'rblineprof'
gem 'rblineprof-report'

And then execute:

$ bundle

How to Use

require 'rblineprof'
require 'rblineprof-report'

target = 'app.rb' # or regular expression like /./
profile = lineprof(target) do
  ...
end
LineProf.report(profile)

Result Example:

[LineProf] ===============================================================

example.rb
               |   4  target = /./
               |   5  profile = lineprof(target) do
 102.8ms     1 |   6    sleep 0.1
               |   7  end
               |   8  LineProf.report(profile)

Options

thresholds

Change thresholds to show as:

LineProf.report(profile, threshods: {
  LineProf::CRITICAL => 1000, # default:  50 (ms)
  LineProf::WARNING  =>  100, # default:   5 (ms)
  LineProf::NOMINAL  =>   10, # default: 0.2 (ms)
})

out

Outputs to a file:

LineProf.report(profile, out: '/tmp/report.txt')

Special Thanks

This is a simple port of rack-lineprof to make it possible to use in non-rack application.