Skip to content

Instantly share code, notes, and snippets.

Masahiro Nakagawa repeatedly

Block or report user

Report or block repeatedly

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View 2.3.5.md
ruby 2.3.5p376 (2017-09-14 revision 59905) [x86_64-linux]
built-in mem: 178476 duration: 5.132209188
jemalloc 3.0.0 mem: 176224 duration: 4.000590038
jemalloc 3.1.0 mem: 176228 duration: 3.905287789
jemalloc 3.2.0 mem: 181496 duration: 3.884209287
jemalloc 3.3.0 mem: 181512 duration: 3.993662677
jemalloc 3.3.1 mem: 183572 duration: 3.883753324
jemalloc 3.4.0 mem: 181564 duration: 3.92800123
jemalloc 3.4.1 mem: 181500 duration: 3.842475057
@repeatedly
repeatedly / result.md
Created Nov 19, 2017
Cool.io Timer result between 2.4 and 2.5
View result.md

2.5.0-dev

% ruby --version
ruby 2.5.0dev (2017-11-18 trunk 60833) [x86_64-darwin15]

% ruby timer_test.rb
Traceback (most recent call last):
        3: from t_test.rb:16:in `<main>'
        2: from /Users/repeatedly/.rbenv/versions/2.5.0-dev/lib/ruby/gems/2.5.0/gems/cool.io-1.5.1/lib/cool.io/loop.rb:88:in `run'
@repeatedly
repeatedly / Log.md
Created Sep 7, 2017
rubygems 2.4.8と2.5.0以降の依存解決の違い
View Log.md

gem 2.4.8

  • with pre activesupport 4.2.8 installation
% gem i draper -v 1.4.0 --no-doc --explain
Gems to install:
  i18n-0.8.6
  thread_safe-0.3.6
  tzinfo-1.2.3
@repeatedly
repeatedly / dig_bench.rb
Created Jul 19, 2017
dig benchmark for fluentd
View dig_bench.rb
require 'benchmark'
class Test0
def initialize(key)
@key = key
end
def call(record)
record[@key]
end
@repeatedly
repeatedly / fluent.conf
Last active Mar 21, 2017
Fluentd: HTTP input simple benchmark
View fluent.conf
<source>
@type http
port 8888
</source>
<match test.**>
@type flowcounter_simple
</match>
@repeatedly
repeatedly / fluent.conf
Last active Nov 15, 2016
Sync like file transfer with v0.14
View fluent.conf
<source>
@type tail
path in/*.log
path_key tailed_path
read_from_head true
tag logs.tail
<parse>
@type none
</parse>
View out_elasticsearch2.rb
# encoding: UTF-8
require 'date'
require 'excon'
require 'elasticsearch'
require 'uri'
begin
require 'strptime'
rescue LoadError
end
View build_td_agent_on_centos5.md

Build step on CentOS5

Use /home/repeatedly/lib for installation directory. Change the path on your environment.

Setup Ruby

Download openssl, zlib and ruby on host and copy to CentOS5

$ pwd
@repeatedly
repeatedly / json_decode.rb
Created Dec 16, 2015
JSON encode / decode comparison
View json_decode.rb
# Result
#valid
#{"k"=>"vvv"}
#{"k"=>"vvv"}
#{"k"=>"vvv"}
#invalid utf-8 with US-ASCII
#{"k"=>"v\xFFvv"}
#{"k"=>"v\xFFvv"}
#"Yajl: error: lexical error: invalid bytes in UTF8 string.\n # {\"k\":\"v\xFFvv\"}\n (right here) ------^\n"
View bench_hash_to_proc.rb
require 'benchmark'
hash = { a: 1, b: 2, c: 3 }
keys = %i[a c d]
hash_proc = hash.to_proc
n = 500000
Benchmark.bmbm do |x|
x.report('&hash') { n.times do
You can’t perform that action at this time.