Skip to content

Instantly share code, notes, and snippets.

View frsyuki's full-sized avatar

Sadayuki Furuhashi frsyuki

View GitHub Profile
@frsyuki
frsyuki / prelink.conf
Created November 9, 2011 03:30
CentOS 5.7 prelink-0.4.0-2.el5.x86_64.rpm
require 'eventmachine'
module DummyServer
end
puts "start thread"
th = Thread.new do
while true
sleep 0.1
p Time.now
diff --git a/lib/fluent/plugin/in_scribe.rb b/lib/fluent/plugin/in_scribe.rb
index 5a9595d..46750fb 100644
--- a/lib/fluent/plugin/in_scribe.rb
+++ b/lib/fluent/plugin/in_scribe.rb
@@ -100,7 +100,7 @@ class ScribeInput < Input
begin
msgs.each { |msg|
record = {
- 'message' => msg.message
+ 'message' => msg.message.force_encoding('UTF-8')
@frsyuki
frsyuki / gist:1366436
Created November 15, 2011 08:09
ruby-1.9.2p290 + fluentd-0.10.6 GC profile
GC 2810 invokes.
Index Invoke Time(sec) Use Size(byte) Total Size(byte) Total Object GC Time(ms)
1 0.370 2096640 3883008 96933 10.00000000000000888178
2 0.390 2088520 3899392 97342 0.00000000000000000000
3 0.420 2088200 3899392 97342 10.00000000000000888178
4 0.450 2088200 3899392 97342 0.00000000000000000000
5 0.480 2088200 3899392 97342 10.00000000000000888178
6 0.520 2088200 3899392 97342 0.00000000000000000000
7 0.560 2088200 3899392 97342 0.00000000000000000000
8 0.580 2088200
@frsyuki
frsyuki / in_forward + out_file
Created November 15, 2011 09:47
ruby-1.9.2p290 + fluentd-0.10.6 performance profile
Thread ID: 15028500
Total Time: 42.363290601
%total %self total self wait child calls Name
--------------------------------------------------------------------------------
100.00% 0.00% 42.36 0.00 0.00 42.36 1 Fluent::EngineClass#run
42.36 0.01 0.00 42.35 1/1 Coolio::Loop#run
0.00 0.00 0.00 0.00 2/2 <Class::Coolio::Loop>#default
0.00 0.00 0.00 0.00 1/2 Class#new
0.00 0.00 0.00 0.00 1/1 Coolio::Loop#attach
@frsyuki
frsyuki / "self" is large
Created November 15, 2011 10:02
ruby-1.9.2p290 + fluentd-0.10.6 performance profile
%total %self total self wait child calls Name
--------------------------------------------------------------------------------
in_forward + out_file
--------------------------------------------------------------------------------
0.88 0.00 0.00 0.88 47/18382 Method#call
37.75 0.05 0.00 37.70 18335/18382 Coolio::IO#on_readable
91.39% 0.11% 38.63 0.05 0.00 38.59 18382 Fluent::ForwardInput::Handler#on_read_msgpack
38.54 1.61 0.00 36.93 18382/18382 MessagePack::Unpacker#feed_each
0.05 0.03 0.00 0.02 18382/18382 Method#to_proc
@frsyuki
frsyuki / fluent.conf
Created November 16, 2011 01:14
fluentd-0.10.7 parallel output/input configuration example
<source>
type http
port 18888
detach_process 5 # 5プロセスで並列化
</source>
<match **>
type forward
buffer_type file
buffer_path /var/fluent/buffer/forward1
import org.msgpack.packer.Packer;
import org.msgpack.unpacker.Unpacker;
public class Client {
public Client(String host, int port);
public void call(String slotName, Object args...);
public T getInterface(Class<T> iface); // for convenience
public Packer openStream(String slotName);
+   +
  ∧_∧ +
 (0゜・∀・) ワクワク
 (0゚ つと) +テカテカ
 と__)__)  +
diff --git a/src/main/java/org/msgpack/io/LinkedBufferInput.java b/src/main/java/org/msgpack/io/LinkedBufferInput.java
index 9d85140..7c03183 100644
--- a/src/main/java/org/msgpack/io/LinkedBufferInput.java
+++ b/src/main/java/org/msgpack/io/LinkedBufferInput.java
@@ -369,6 +369,14 @@ public class LinkedBufferInput extends AbstractInput {
}
}
+ public int getSize() {
+ int size = 0;