Skip to content

Instantly share code, notes, and snippets.

View kzk's full-sized avatar
🍶

Kazuki Ohta kzk

🍶
View GitHub Profile
e = Event.new
e.timestamp = Time.now.to_i
e.category = 'counter.blog'
e.key = ['net', 'kzk9', 'blog', 'tornado']
e.value = 1
p client.Post(e)
@kzk
kzk / td-agent.conf.erb
Created December 19, 2011 07:13
default.rb
#
# Cookbook Name:: td-agent
# Recipe:: default
#
# Copyright 2011, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#
group 'td-agent' do
@kzk
kzk / build.sbt
Created January 4, 2012 18:50
SBT's build.sbt for fluent-logger-java
// Repositories
resolvers ++= Seq(
"td-logger Maven2 Repository" at "http://treasure-data.com/maven2/",
"fluent-logger Maven2 Repository" at "http://fluentd.org/maven2/"
)
// Dependencies
libraryDependencies ++= Seq(
"com.treasure_data" % "td-logger" % "0.1.0"
)
# Scribe input
<source>
type scribe
port 1463
</source>
# match tag=debug.** and dump to console
<match debug.**>
type null
</match>
array(7) {
["stream_type"]=>
string(14) "tcp_socket/ssl"
["mode"]=>
string(2) "r+"
["unread_bytes"]=>
int(0)
["seekable"]=>
bool(false)
["timed_out"]=>
#
# Example Input
#
# time=1335851771&a=b&c=d&d=e
#
# Example Conf:
#
# <source>
# type tail_kv
# path /path/to/the/file1
#
# Example Input
#
# 1335851771|a|b
#
# Example Conf:
#
# <source>
# type tail_char_delim
# path /path/to/the/file1
@kzk
kzk / td-synchronous-job-issue.rb
Created May 3, 2012 01:05
td-synchronous-job-issue.rb
require 'td'
require 'td-client'
cln = TreasureData::Client.new(ENV['TREASURE_DATA_API_KEY'])
job = cln.query('testdb', 'SELECT COUNT(1) FROM www_access')
until job.finished?
sleep 2
job.update_status!
end
if job.success?
gem "unicorn", "~> 4.3.1"
web: bundle exec unicorn -c lib/unicorn/config.rb -p $PORT