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 @@
require_relative 'wendelin_test'
require 'msgpack'
require 'time'
#puts [1,2,'hello'].to_msgpack
ingest 'ABC-HELLO-01.cat', [1,2,'hello'].to_msgpack
#ingest 'ABC-HELLO-01.cat', ', hello'
#ingest 'ABC-HELLO-01.tac', ', magic'
# t -> 2015-08-11 14:51:50+02:00
def tfmt(t)
t.strftime('%Y-%m-%d %H:%M:%S%:z')
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