noahd1 / oink

Log parser to identify actions which significantly increase VM heap size
MIT License
1.18k stars 71 forks source link

Can oink be used with Sinatra? #19

Open erikrob opened 11 years ago

erikrob commented 11 years ago

From what I read it seems highly coupled with Rails but was wondering if anyone ever attempted/managed to use it with Sinatra?

noahd1 commented 11 years ago

It used to be pretty coupled with Rails when it used controller filters. But now it uses Middleware and activerecord hooks, so you should be able to use it just fine with Sinatra. Let me know if you run into any trouble.

nathany commented 11 years ago

Any plans to split off the ActiveRecord dependencies as some sort of plugin?

noahd1 commented 11 years ago

No plans, but seems like a sensible idea. In the very least, oink should not blow up if you've only configured the middleware to log memory footprints (and not AR instances). Can you confirm that is the case, and if so, open up an issue about it?

nathany commented 11 years ago

I can confirm that it works fine in this case (with a NestaCMS/Sinatra app). I'm not 100% sure whether or not AR is loaded/impacting the memory footprint.

kakubei commented 10 years ago

Could someone tell me how to set it up with Padrino (Sinatra based) and Heroku please?

I have installed it locally and set it up in app/app.rb as such:

  use Oink::Middleware do
    set :logger => Hodel3000CompliantLogger.new(STDOUT)
  end

Did some work loally in development mode, then tried to see something in the logs with:

oink --format verbose --threshold=0 log/development.log
or
oink --format verbose --threshold=1 log/development.log

But it was empty.

On Heroku, I got this error while trying to startup the app:

Rack app error: #<Errno::ENOENT: No such file or directory - log/oink.log>