Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
in_sample: support to renew record functionality
When in_sample plugin is used with filter parser which uses remove_key_name_field, it raises the following error repeatedly. #0 dump an error event: error_class=ArgumentError error="message does not exist" This kind of error occurs when key_name and remove_key_name_field removes key from record with destructive change in filter parser. It affects generated sample data. To fix this issue, it is simple to just dup every record even though it has a significant performance penalty. Considering keeping compatibility and providing way to a workaround, added option to enable previous behavior - reuse_record, disabled by default. ref. #4575 Here is the small benchmark: <source> @type sample tag test size xxx rate 100 reuse_record </source> <match test> @type null </match> size: 100000 master: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 330767 kenhys 20 0 364316 81036 13620 S 100.3 0.1 0:52.10 ruby reuse_record: true PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 333640 kenhys 20 0 364328 80956 13560 S 100.0 0.1 0:17.04 ruby reuse_record: false PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 335843 kenhys 20 0 366188 113300 13536 S 100.3 0.2 0:17.24 ruby Signed-off-by: Kentaro Hayashi <[email protected]>
- Loading branch information