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)
<match hoge.tag>
type copy
<store>
type mongo
database backup
connection hoge
host localhost
port 11111
h = fluent.handler.FluentHandler('app.follow', port=self._port)
logging.basicConfig(level=logging.INFO)
l = logging.getLogger('fluent.test')
l.addHandler(h)
l.info({
'from': 'userA',
'to': 'userB'
})
diff --git a/fluent/sender.py b/fluent/sender.py
index 38580ef..202caaa 100644
--- a/fluent/sender.py
+++ b/fluent/sender.py
@@ -60,7 +60,7 @@ class FluentSender(object):
self.socket = None
def _make_packet(self, label, data):
- tag = '.'.join(self.tag, label)
+ tag = '.'.join([self.tag, label])
@kzk
kzk / gist:1259689
Created October 3, 2011 17:32
match_cache.diff
diff --git a/lib/fluent/engine.rb b/lib/fluent/engine.rb
index 10e747c..6af8278 100644
--- a/lib/fluent/engine.rb
+++ b/lib/fluent/engine.rb
@@ -22,6 +22,7 @@ class EngineClass
def initialize
@matches = []
@sources = []
+ @match_cache = {}
end
heroku create --stack cedar
git push heroku master
git init
git add .
git commit -m "Initial Commit"
cat >.gitignore <<EOF
bin/
include/
lib/
share/
src/
EOF
cat >Procfile <<EOF
web: ./bin/gunicorn -k tornado --workers=4 --bind=0.0.0.0:$PORT hello
EOF
cat >hello.py <<EOF
import tornado.ioloop
import tornado.web
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.write("Hello, world")
application = tornado.web.Application([
(r"/", MainHandler),