Commit eaf58c4b authored by Kirill Smelkov's avatar Kirill Smelkov

test: Provide a closer to realistic ingestion example

Instead of ingesting just [1,2,'hello'] list, ingest in format closer to what
fluentd sends - i.e. "t" and dict/hash of name->value pairs.
parent ff5f6840
...@@ -4,8 +4,17 @@ ...@@ -4,8 +4,17 @@
require_relative 'wendelin_test' require_relative 'wendelin_test'
require 'msgpack' require 'msgpack'
require 'time'
#puts [1,2,'hello'].to_msgpack # t -> 2015-08-11 14:51:50+02:00
ingest 'ABC-HELLO-01.cat', [1,2,'hello'].to_msgpack def tfmt(t)
#ingest 'ABC-HELLO-01.cat', ', hello' t.strftime('%Y-%m-%d %H:%M:%S%:z')
#ingest 'ABC-HELLO-01.tac', ', magic' end
t = Time.now
s = ''
s += [1, {'date' => tfmt(t), 'hello' => 1, 'world' => 2}].to_msgpack
s += [2, {'date' => tfmt(t+1), 'pi' => 3.1415, 'e' => 2.71828}].to_msgpack
# puts s
ingest 'testds', s
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment