tagomoris / fluent-plugin-flowcounter

TODO: one-line summary of your gem
Other
53 stars 20 forks source link

add clock output format support #20

Closed 0xMadao closed 7 years ago

0xMadao commented 7 years ago

hi, tagomoris we want to count records and show it at every hour or minute or day, for example, if we start at 2017-07-23 13:04:10, and if use clock output format, it will count and show at 14:00:00、15:00:00...(interval is hourly) or 13:05:00、13:06:00...(interval is minutely) or 2017-07-24 00:00:00、2017-07-25 00:00:00...(interval is daily)

tagomoris commented 7 years ago

I've added this feature as timestamp_counting to the version v1.1.0 (it requires Fluentd v0.14). https://github.com/tagomoris/fluent-plugin-flowcounter#generate-output-at-zero-time

Thank you for good feature idea!

0xMadao commented 7 years ago

One more question, if fluentd is v0.12, will timestamp_counting work normally?

tagomoris commented 7 years ago

No. The reason I didn't add it to the v0.12 version is that Fluentd v0.12 has just poor APIs to handle timestamps and testing framework to test when the plugin can emit output results. Your patch doesn't have tests (it's hard to write such tests because of poor testing framework support of Fluentd v0.12), and has a bug about daily counting (your code just works as expected with local timestamp, but will work unexpectedly on AWS EC2 hosts).

0xMadao commented 7 years ago

um... In this case, I suggest add the version limit support in README

tagomoris commented 7 years ago

Good suggestion! Done https://github.com/tagomoris/fluent-plugin-flowcounter/commit/0517ff13065cd1be6a7bb6d16a55098e91622ec8