Skip to content

Instantly share code, notes, and snippets.

@fujiwara
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fujiwara/11133534 to your computer and use it in GitHub Desktop.
Save fujiwara/11133534 to your computer and use it in GitHub Desktop.
benchmark of fluent-plugin-parser time_parse cache
#!/usr/bin/env ruby
start = Time.now
`cat access.log.ltsv | fluent-agent-lite accesslog - 127.0.0.1`
puts "elapsed #{(Time.now - start)*1000} ms"
<source>
type forward
</source>
<match accesslog>
type parser
tag parsed
format ltsv
key_name message
</match>
<match parsed>
type stdout
</match>
$ fluentd -c fluentd.conf > /dev/null &
$ wc -l access.log.ltsv
10000 access.log.ltsv
$ ruby bench.rb # plugin-parser 0.3.2
elapsed 8822.374 ms
$ ruby bench.rb # plugin-parser 0.3.2 + cache
elapsed 2817.758 ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment