-
Notifications
You must be signed in to change notification settings - Fork 20
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
Add profiling capabilities to consumer and producer #109
Conversation
\cc @smola @ajnavarro for review |
Codecov Report
@@ Coverage Diff @@
## master #109 +/- ##
=======================================
Coverage 66.26% 66.26%
=======================================
Files 11 11
Lines 821 821
=======================================
Hits 544 544
Misses 213 213
Partials 64 64 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
- I would use
github.com/pkg/profile
, which has a simpler API and deals with some of the tricky details - Maybe we should add a configurable profiler (with environment variables) in
src-d/core-retrieval
, which we can add to a single line to any command (e.g.defer core. Profiler().Start().Stop()
) - It's a bit unexpected that in one command there is a flag that enables HTTP profiler with a hardcoded address and port, and the other command has 2 flags to enable memory and cpu profilers dumping to a file. It would be nice to be able to access both in any case.
- Add access to the block profile too!
Did not know about this one 😳 thank for pointing out, will look into that and switch.
this sounds good, but please keep in mind that its just an initial work. I would add such improvement to backlog and deal in separate PR after we done some profiling sessions and understand better what we actually need.
I agree, and ofcourse it's not set in stone, but it has a rationale - profiler API for "saving to files" works very well in case of short-live processes, which os.Exit. HTTP API was designed for long-running servers and by default works with samples in 30sec interval, but is available all the time. So it was uses the same way here, and in Berserkers (CLI vs Server) and Bblfsh server (Client vs Server). Right now, I would keep it like that as it's already useful (low hanging fruit), not to spend to much time at this first step, but it can be further improved in subsequent PRs of course. Let me know what you think! |
@bzz Note that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we implement it using http as santiago said?
Sure, I will take care of it tomorrow, scope updated in PR description. |
37cce01
to
1ad9f52
Compare
History re-written, now both consumer and producer expose CPU, memory and block profilers over HTTP |
producer: add--cpuprofile
and--memprofile
CLI flags to save profiles to FS--profiler
flag to expose profiler data over HTTPUpdate
borges producer
to HTTP as it's a long-running service exposing--profiler
and--profiler-port