test/plugin/test_out_flowcounter.rb in fluent-plugin-flowcounter-0.1.9 vs test/plugin/test_out_flowcounter.rb in fluent-plugin-flowcounter-0.2.0
- old
+ new
@@ -29,31 +29,46 @@
}
d = create_driver %[
count_keys message
]
assert_equal :minute, d.instance.unit
+ assert_equal 60, d.instance.tick
assert_equal :tag, d.instance.aggregate
assert_equal :joined, d.instance.output_style
assert_equal 'flowcount', d.instance.tag
assert_nil d.instance.input_tag_remove_prefix
assert_equal ['message'], d.instance.count_keys
d = create_driver %[
count_keys field1,field2
]
assert_equal :minute, d.instance.unit
+ assert_equal 60, d.instance.tick
assert_equal :tag, d.instance.aggregate
assert_equal :joined, d.instance.output_style
assert_equal 'flowcount', d.instance.tag
assert_nil d.instance.input_tag_remove_prefix
assert_equal ['field1', 'field2'], d.instance.count_keys
d = create_driver %[
+ unit second
+ count_keys message
+ ]
+ assert_equal :second, d.instance.unit
+ assert_equal 1, d.instance.tick
+ assert_equal :tag, d.instance.aggregate
+ assert_equal :joined, d.instance.output_style
+ assert_equal 'flowcount', d.instance.tag
+ assert_nil d.instance.input_tag_remove_prefix
+ assert_equal ['message'], d.instance.count_keys
+
+ d = create_driver %[
unit hour
count_keys message
]
assert_equal :hour, d.instance.unit
+ assert_equal 3600, d.instance.tick
assert_equal :tag, d.instance.aggregate
assert_equal :joined, d.instance.output_style
assert_equal 'flowcount', d.instance.tag
assert_nil d.instance.input_tag_remove_prefix
assert_equal ['message'], d.instance.count_keys
@@ -61,10 +76,11 @@
d = create_driver %[
output_style tagged
count_keys message
]
assert_equal :minute, d.instance.unit
+ assert_equal 60, d.instance.tick
assert_equal :tag, d.instance.aggregate
assert_equal :tagged, d.instance.output_style
assert_equal 'flowcount', d.instance.tag
assert_nil d.instance.input_tag_remove_prefix
assert_equal ['message'], d.instance.count_keys
@@ -75,10 +91,11 @@
tag test.flowcount
input_tag_remove_prefix test
count_keys message
]
assert_equal :day, d.instance.unit
+ assert_equal 86400, d.instance.tick
assert_equal :all, d.instance.aggregate
assert_equal :joined, d.instance.output_style
assert_equal 'test.flowcount', d.instance.tag
assert_equal 'test', d.instance.input_tag_remove_prefix
assert_equal ['message'], d.instance.count_keys
@@ -89,9 +106,10 @@
tag test.flowcount
input_tag_remove_prefix test
count_keys *
]
assert_equal :day, d.instance.unit
+ assert_equal 86400, d.instance.tick
assert_equal :all, d.instance.aggregate
assert_equal :joined, d.instance.output_style
assert_equal 'test.flowcount', d.instance.tag
assert_equal 'test', d.instance.input_tag_remove_prefix
assert d.instance.count_all