Skip to content

Instantly share code, notes, and snippets.

@pitr
Last active November 29, 2022 04:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pitr/9a518e840db58f435911 to your computer and use it in GitHub Desktop.
Save pitr/9a518e840db58f435911 to your computer and use it in GitHub Desktop.

Run with

  1. bundle install --binstubs
  2. mkdir reports
  3. bin/ruby-prof --mode=cpu -x 'Kernel#gem_original_require' -x 'Kernel#require' -x 'Kernel#load' -f reports -p multi --exclude-common-callbacks --exclude-common-cycles -- bin/fluentd --config fluent.conf --no-supervisor
  4. Ctrl-C after a few seconds and wait for it to finish
  5. Look at reports/
<source>
@type dummy
tag to.es
dummy {"hello":"world","@timestamp":"Thu Nov 29 14:33:20 GMT 2001"}
rate 1000
</source>
<match to.es>
@type elasticsearch
logstash_format true
buffer_chunk_limit 64k
flush_interval 2s
</match>
source 'https://rubygems.org'
gem 'fluentd'
gem 'fluent-plugin-elasticsearch'
gem 'ruby-prof'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment