Skip to content

Instantly share code, notes, and snippets.

Avatar

Sadayuki Furuhashi frsyuki

View GitHub Profile
@frsyuki
frsyuki / mp_test.rb
Created May 17, 2012 — forked from methane/mp_test.rb
testing MessagePack memory usage.
View mp_test.rb
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.
View gist:2234507
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.