Skip to content

Instantly share code, notes, and snippets.

View frsyuki's full-sized avatar

Sadayuki Furuhashi frsyuki

View GitHub Profile
@frsyuki
frsyuki / mp_test.rb
Created May 17, 2012 18:54 — forked from methane/mp_test.rb
testing MessagePack memory usage.
require 'msgpack'
msg = MessagePack::pack("a" * 1024)
while true do
MessagePack::unpack(msg)
GC.start
end
We couldn’t find that file to show.
We couldn’t find that file to show.
def emit(tag, es, chain)
t = if @sample_unit == :all
'all'
else
tag
end
# Access to @counts SHOULD be protected by mutex, with a heavy penalty.
# Code below is not thread safe, but @counts (counter for sampling rate) is not
# so serious value (and probably will not be broke...),
# then i let here as it is now.