Sha256: 02cadc97a7488da0b3b3a36d2112c105bbe5db428e6b3a2399cbd277f4a8a2f4

Contents?: true

Size: 923 Bytes

Versions: 3

Compression:

Stored size: 923 Bytes

Contents

# encoding: UTF-8
require_relative 'spec_helper'

# setup
Fluent::Test.setup
config = %[
  input_key message
  grep INFO
  exlude something
  remove_tag_prefix foo
  add_tag_prefix bar
]
time = Time.now.to_i
tag = 'foo.bar'
driver = Fluent::Test::OutputTestDriver.new(Fluent::GrepOutput, tag).configure(config)

# bench
require 'benchmark'
message = "2013/01/13T07:02:11.124202 INFO GET /ping"
n = 100000
Benchmark.bm(7) do |x|
  x.report { driver.run { n.times { driver.emit({'message' => message}, time) } } }
end

# BEFORE TAG_PROC
#              user     system      total        real
#          2.560000   0.030000   2.590000 (  3.169847)
# AFTER  TAG_PROC (0.2.1)
#              user     system      total        real
#          2.480000   0.040000   2.520000 (  3.085798)
# AFTER  regexps, exludes (0.3.0) 
#              user     system      total        real
#          2.700000   0.050000   2.750000 (  3.340524)

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fluent-plugin-grep-0.3.2 spec/out_grep_bench.rb
fluent-plugin-grep-0.3.1 spec/out_grep_bench.rb
fluent-plugin-grep-0.3.0 spec/out_grep_bench.rb