0.0
No commit activity in last 3 years
No release in over 3 years
Tiny profiler for ruby
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0
 Project Readme

TinyProfiler

Very simple profiler - to be used with or without rails.

Installation

Add this line to your application's Gemfile:

gem 'tiny_profiler'

And then execute:

$ bundle

Or install it yourself as:

$ gem install tiny_profiler

Usage

require 'tiny_profiler'
TinyProfiler.instance.start
(do something)
TinyProfiler.instance.interval("heavy operation")
=> "heavy operation: 14.786334"
(do something)
TinyProfiler.instance.interval("second operation")
=> "second operation: 3.453059"
(do something)
TinyProfile.instance.finished
=> {"heavy operation"=>14.786334, "second operation"=>3.453059, "total"=>22.390635}

You can reset all timers using

TinyProfiler.instance.reset

or

Tinyprofiler.instance.start

It's singleton, so you can basically use it through your application when tracing some complicated operation.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request