Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manual config tips for non-Rails? #2

Open
subvertallchris opened this issue Feb 28, 2015 · 8 comments
Open

Manual config tips for non-Rails? #2

subvertallchris opened this issue Feb 28, 2015 · 8 comments

Comments

@subvertallchris
Copy link
Contributor

I'm trying to tune GC for a Sinatra/Padrino app, so it looks like I need to setup the manual agent. Do you have any recommendations for this?

@methodmissing
Copy link
Member

Hi @subvertallchris , we can create a new Spy that plugs into Sinatra during the next few days

@methodmissing
Copy link
Member

Alternatively, if there's a really urgent need, there's a few example spies in https://github.com/bear-metal/tunemygc/tree/master/lib/tunemygc/spies (minitest and active_job are good base examples for this use case I think). What's most important is hooks for:

  • When the framework / app booted
  • Start of a request
  • End of a request

I documented these important lifecycle events in https://github.com/bear-metal/tunemygc/blob/master/doc/protocol.md#tunemygc-protocol . The above 3 needs to be covered, the GC specific ones are covered by tracepoints.

@subvertallchris
Copy link
Contributor Author

Perfect, thank you! This is a really cool gem, thank you for making this available.

@subvertallchris
Copy link
Contributor Author

I threw together a spy for RSpec but receive this upon completion:

Ruby version 2.2.0 or Rails version 0.0 not supported. Failed to sync 211 snapshots

It works if I tell it I'm running Rails 4.1.7, though I guess those results might not be optimal. ;-)

Happy to send a PR with this once it's working, if you'd like.

@methodmissing
Copy link
Member

Send! :-)

@subvertallchris
Copy link
Contributor Author

Will do once I'm home. It's pretty crude, really just the minitest class
with the hooks swapped out. Is there a change I need to make to fix that
Rails version error?

On Saturday, February 28, 2015, Lourens Naudé notifications@github.com
wrote:

Send! :-)


Reply to this email directly or view it on GitHub
#2 (comment).

@methodmissing
Copy link
Member

I can take a stab at it

@subvertallchris
Copy link
Contributor Author

I'm a little short on time and haven't worked with minitest much, so please excuse my lack of tests.

It might be nice if there was a BaseSpy class, since there's so much shared behavior. The unique qualities of each subclass could be defined in methods or constants within the subclasses, then users could override or add behavior as needed. The instance variables @tests_processed and @tests_limit could be generalized. It'd make it very easy to add new spies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants