Fluent::Rubyprof
Using fluent-rubyprof, you can start and stop ruby-prof dynamically from outside of fluentd without any configuration changes.
Prerequisite
in_debug_agent
plugin is required to be enabled.
<source>
type debug_agent
port 24230
</source>
And, ruby-prof
gem is required.
$ fluent-gem install ruby-prof
Installation
$ fluent-gem install fluent-rubyprof
Usage
Start
$ fluent-rubyprof start -h localhost -p 24230
Stop and write a profiling result.
$ fluent-rubyprof stop -h localhost -p 24230 -o /tmp/fluent-rubyprof.txt
Options
parameter | description | default |
---|---|---|
-h, --host HOST | fluent host | 127.0.0.1 |
-p, --port PORT | debug_agent port | 24230 |
-u, --unix PATH | use unix socket instead of tcp | |
-o, --output PATH | output file | /tmp/fluent-rubyprof.txt |
-m, --measure_mode MEASURE_MODE | ruby-prof measure mode. See ruby-prof#measurements | PROCESS_TIME |
-P, --printer PRINTER | ruby-prof print format. See ruby-prof#printers | flat |
Further Reading
- Fluentd の debug_agent 経由で ruby-prof を起動する (Japanese)
ChangeLog
See CHANGELOG.md
Contributing
- Fork it ( http://github.com/sonots/fluent-rubyprof/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Copyright
See LICENSE.txt
Special Thanks
I refered implemention of fluent-tail. Thanks!