1
0
mirror of https://github.com/meineerde/rackstash.git synced 2026-02-18 17:41:58 +00:00

12 Commits

Author SHA1 Message Date
59c94a8ecc Insert newline comment below magic comments in ruby file header 2017-09-29 17:15:07 +02:00
f8d8c040d5 Optimize the TruncateMessage filter with Proc selectors
If we have a proc, we can pass it directly to the `select!` method
instead of having to manually call the selector. This gives a
significant speedup for the common case of simple selectors:

    require 'benchmark/ips'
    Benchmark.ips do |x|
      selector = ->(value) { value < 500 }
      values = (1..1000).to_a

      x.report("call") { values.select { |v| selector.call(v) } }
      x.report("block") { values.select(&selector) }

      x.compare!
    end

    Warming up --------------------------------------
                    call   663.000  i/100ms
                   block     1.598k i/100ms
    Calculating -------------------------------------
                    call      6.897k (± 4.8%) i/s -     34.476k in   5.011617s
                   block     16.561k (± 4.2%) i/s -     83.096k in   5.026999s

    Comparison:
                   block:    16560.7 i/s
                    call:     6896.5 i/s - 2.40x  slower
2017-09-23 01:16:27 +02:00
3db9041ab4 Use the short filter syntax in the TruncateMessage example 2017-09-23 01:16:27 +02:00
f17692ff73 Add Update filter to set new values to existing event keys 2017-09-23 00:50:46 +02:00
d66408d333 Fix typos and omissions in the documentation of the Replace filter 2017-09-23 00:40:40 +02:00
c383e2b3dc Add Replace filter to set new values on event fields 2017-09-23 00:26:03 +02:00
a827769bb3 Add Rename filter to rename event fields 2017-09-23 00:14:56 +02:00
0a5e0a4aab Add TruncateMessage filter to restrict the size of the logged message 2017-08-16 00:43:09 +02:00
0a1fe46ea5 Add filter to remove all ANSI color codes from the event message 2017-08-14 23:18:19 +02:00
168e62b63c Remove useless newlines 2017-08-12 14:02:03 +02:00
b72b8cf94b Fix @return documentation tag for Rackstash::Filters::SkipEvent#call 2017-07-19 11:09:32 +02:00
e21108b7c2 Add first example SkipEvent filter 2017-07-18 23:13:35 +02:00