noahd1 / oink

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

Oink and serving assets #25

Open nathany opened 11 years ago

nathany commented 11 years ago

Would it be possible to filter out oink logging when Rails is serving assets (in development)?

It currently spams my logs like this (asset logging itself is being silenced, otherwise those requests would show up):

Feb 07 12:36:18 zephyr rails[2941]: Memory usage: 2658288 | PID: 2941
Feb 07 12:36:18 zephyr rails[2941]: Oink Log Entry Complete
Feb 07 12:36:18 zephyr rails[2941]: Memory usage: 2658288 | PID: 2941
Feb 07 12:36:18 zephyr rails[2941]: Oink Log Entry Complete
Feb 07 12:36:18 zephyr rails[2941]: Memory usage: 2658288 | PID: 2941
Feb 07 12:36:18 zephyr rails[2941]: Oink Log Entry Complete
Feb 07 12:36:18 zephyr rails[2941]: Memory usage: 2658288 | PID: 2941
...
noahd1 commented 11 years ago

Since Oink is executed in Rack Middleware, an approach like this might be a good way to go:

http://icelab.com.au/articles/wrapping-rack-middleware-to-exclude-certain-urls-for-rails-streaming-responses/

Happy to accept a patch that works similarly to this for Oink's middleware.

KieranP commented 10 years ago

Any progress with this?

noahd1 commented 10 years ago

Seems like this is basically a development-only kind of issue. Are you making use of Oink in development? If not would just suggest turning oink off entirely in development mode. Otherwise, not sure -- you could wrap the oink middleware in your own to exclude assets.

nathany commented 10 years ago

Just fyi, we're no longer using Oink in development.