-
Notifications
You must be signed in to change notification settings - Fork 1.8k
filter_watermark: The initial commit for filter watermark #3459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Fenggang <ginobiliwang@gmail.com>
| REGISTER_OUT_PLUGIN("out_cloudwatch_logs") | ||
| REGISTER_OUT_PLUGIN("out_kinesis_firehose") | ||
| REGISTER_OUT_PLUGIN("out_kinesis_streams") | ||
| REGISTER_OUT_PLUGIN("out_prometheus_exporter") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Intentional change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be some merge issue, let me fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still looks wrong in the diff, does this need rebasing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, i will rebase it in a whole after Masoud's initial review.
|
Is there an well known and tested 3rd party heap implementation, as an alternative? |
Most of implementations are customized versions. For this plugin, i have done customization as well. |
|
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
|
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
|
@koleini ping |
|
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
|
@koleini ,can you help to review this PR ? |
|
This pull request requires documentation and unit tests to be included. In addition, there are indentation problems in the code that needs to be fixed. Please see https://github.com/fluent/fluent-bit/blob/master/CONTRIBUTING.md for the guidelines. |
|
Hi @koleini , this is the doc PR fluent/fluent-bit-docs#530 . Let me fix the format issue and fill up unit tests. |
Signed-off-by: Fenggang <ginobiliwang@gmail.com>
|
The binary tree we use is this well known red/black binary tree implementation https://github.com/fluent/fluent-bit/tree/master/lib/rbtree |
|
I did not notice we have rbtree in place to use. And definitely it is ok to use rbtree for current feature. |
|
I'm glad you find it fitting, I agree and would really appreciate it if at some point you updated your code to use it. Thanks a lot! |
|
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
|
will continue to finish this pr soon, tied up by some other affairs. |
|
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
|
sorry for the delay, will catch up ASAP. |
|
HI @leonardo-albertovich , i have tried to use rbtree in fluent bit repo to failed to apply. The main issue is that rbtree could not handle duplicate key. In this PR, it would deal with records with duplicate keys. So i have to revert back to use heap data structure to implement it, i think heap is the best data structure to do the job. BTW, i have accidently closed this PR, would you please help to reopen it. |
|
Hi @leonardo-albertovich , @koleini , @edsiper any chance to reopen this PR ? i can not re-open it by myself. |
|
ping @ginobiliwang |
Thanks @lecaros for reopening the PR. The same question i have post last year, re-paste here. Please review the above, thanks. |
|
pinging @edsiper @leonardo-albertovich and @cosmo0920 to help you out with your question |
|
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
|
pinging @edsiper @leonardo-albertovich and @cosmo0920 |
|
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
|
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
Signed-off-by: Fenggang ginobiliwang@gmail.com
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[root@localhost ~]# nc 127.0.0.1 5170
{"time":"2021-11-12 18:30:00"}
{"time":"2021-11-12 18:30:01"}
{"time":"2021-11-12 18:30:02"}
{"time":"2021-11-12 18:30:07"}
{"time":"2021-11-12 18:30:06"}
{"time":"2021-11-12 18:30:04"}
{"time":"2021-11-12 18:30:05"}
{"time":"2021-11-12 18:31:00"}
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[root@localhost build]# valgrind --leak-check=full bin/fluent-bit -i tcp -F watermark -p 'time_field=time' 'watermark=20' -m '*' -o stdout
==3805== Memcheck, a memory error detector
==3805== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==3805== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==3805== Command: bin/fluent-bit -i tcp -F watermark -p time_field=time watermark=20 -m * -o stdout
==3805==
Fluent Bit v1.7.4
[2021/05/08 22:12:14] [ info] [engine] started (pid=3805)
[2021/05/08 22:12:14] [ info] [storage] version=1.1.1, initializing...
[2021/05/08 22:12:14] [ info] [storage] in-memory
[2021/05/08 22:12:14] [ info] [storage] normal synchronization mode, checksum disabled, max_chunks_up=128
[2021/05/08 22:12:14] [ info] [input:tcp:tcp.0] listening on 0.0.0.0:5170
[2021/05/08 22:12:14] [ info] [sp] stream processor started
==3805== Warning: client switching stacks? SP change: 0x9bc2788 --> 0xa48a850
==3805== to suppress, use: --max-stackframe=9208008 or greater
==3805== Warning: client switching stacks? SP change: 0xa48a7b8 --> 0x9bc2788
==3805== to suppress, use: --max-stackframe=9207856 or greater
==3805== Warning: client switching stacks? SP change: 0x9bc2788 --> 0xa48a7b8
==3805== to suppress, use: --max-stackframe=9207856 or greater
==3805== further instances of this message will not be shown.
[0] tcp.0: [1620483146.702023972, {"time"=>"2021-11-12 18:30:00"}]
[1] tcp.0: [1620483150.354546260, {"time"=>"2021-11-12 18:30:01"}]
[2] tcp.0: [1620483153.771547131, {"time"=>"2021-11-12 18:30:02"}]
[3] tcp.0: [1620483176.174986006, {"time"=>"2021-11-12 18:30:04"}]
[4] tcp.0: [1620483180.376079757, {"time"=>"2021-11-12 18:30:05"}]
[5] tcp.0: [1620483169.903685948, {"time"=>"2021-11-12 18:30:06"}]
[6] tcp.0: [1620483163.781975807, {"time"=>"2021-11-12 18:30:07"}]
^C[2021/05/08 22:13:19] [engine] caught signal (SIGINT)
[2021/05/08 22:13:19] [ warn] [engine] service will stop in 5 seconds
[2021/05/08 22:13:24] [ info] [engine] service stopped
==3805==
==3805== HEAP SUMMARY:
==3805== in use at exit: 99,816 bytes in 3,380 blocks
==3805== total heap usage: 4,229 allocs, 849 frees, 5,092,444 bytes allocated
==3805==
==3805== LEAK SUMMARY:
==3805== definitely lost: 0 bytes in 0 blocks
==3805== indirectly lost: 0 bytes in 0 blocks
==3805== possibly lost: 0 bytes in 0 blocks
==3805== still reachable: 99,816 bytes in 3,380 blocks
==3805== suppressed: 0 bytes in 0 blocks
==3805== Reachable blocks (those to which a pointer was found) are not shown.
==3805== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==3805==
==3805== For lists of detected and suppressed errors, rerun with: -s
==3805== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
[root@localhost build]#