Skip to content

stuartpalmer/bubot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bubot

Take action when methods take too long

Installation

Add this line to your application's Gemfile:

gem 'bubot'

And then execute:

$ bundle

Or install it yourself as:

$ gem install bubot

Usage

Extend Bubot in your class.

This gives you the class method .watch(:method_name, threshold).

If a watched method takes longer than the specified amount of time (threshold), the block will execute.

class Foo
    extend Bubot

    watch(:bar, 1) { run_some_code }

    def bar
        sleep 1.1
    end
end

About

Take action when methods take too long

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%