Sha256: b1fd64f796d70009b999c571f8d9cf24e70ac1ffe17492ce8ccaa80ca21fffe3

Contents?: true

Size: 789 Bytes

Versions: 2

Compression:

Stored size: 789 Bytes

Contents

#!/usr/bin/env ruby
require 'thrift'
$:.unshift File.join(File.dirname(__FILE__), '../lib/fluent/plugin/thrift')
require 'fb303_types'
require 'fb303_constants'
require 'facebook_service'
require 'scribe_types'
require 'scribe_constants'
require 'scribe'

host = 'localhost'
port = 1463

socket = Thrift::Socket.new host, port.to_i
transport = Thrift::FramedTransport.new socket
protocol = Thrift::BinaryProtocol.new transport
client = Scribe::Client.new protocol
transport.open

# 2011/09/02 Kazuki Ohta <kazuki.ohta@gmail.com>
# explicitly specify TCP_NODELAY for low-latency communication.
raw_sock = socket.to_io
raw_sock.setsockopt Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1

entry = LogEntry.new
entry.category = 'hoge'
entry.message = 'fuga'
p client.Log([entry])

transport.close

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fluent-plugin-scribe-0.9.8 bin/fluent-scribe-remote
fluent-plugin-scribe-0.9.7 bin/fluent-scribe-remote