padrino-perf: watch out for problematic conditions in your app #1027
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First of all: this is alpha, ugly and just a proof of concept that I wanted to show you.
This adds a small binary that allows to watch for know error conditions
and hook into certain aspects at startup time of a padrino application
to gather info.
Currently implemented is suite to detect json and yajl being loaded at the same time and tracking who loaded it.
Also, there is a horrible hack to ensure that load_paths added by padrino-perf are always in front of the
$LOAD_PATH
.To try a sample run: add
padrino-perf
,json
andyajl
to your Gemfile. Run:This is basically a nice alias for:
where $ruby is the ruby that called padrino-perf.
Then require
json
andyajl
in any order:Its not really there yet and the implementation is very straigth-forward and generalized, but the technique can be used to built suites that track memory consumption during loading etc.
Its main strength is that it is not a library that you have to put in your Gemfile, but instead 'just' an extended Runtime.