README.md in fluent-plugin-elapsed-time-0.0.5 vs README.md in fluent-plugin-elapsed-time-0.0.6
- old
+ new
@@ -8,17 +8,47 @@
Use RubyGems:
gem install fluent-plugin-elapsed-time
+## Illustration
+
+This illustration draws how fluent-plugin-elapsed-time measures elapsed times.
+
+```
+ +–––––––––––––+ +––––––––––––––+ +––––––––––––––+ +–––––––––––––––+
+ | Input | | ElapsedTime | | Output | | Output |
+ +––––––+––––––+ +––––––+–––––––+ +––––––+–––––––+ +–––––––+–––––––+
+#on_message | | | |
+ +––––––––––––––––––> | |
+ | #emit | start = Time.now | |
+ | +––––––––––––––––––> |
+ | | #emit +–––––––––––––––––––>
+ | | | #emit |
+ | | <– – – – – – – – – +
+ | <– – – – – – – – – + |
+ | | elapsed = Time.now - start |
+ <– – – – – - – – – + | |
+ | | | |
+ + + + +
+```
+
## Configuration
Example:
-Following example measures the max and average time taken to process [fluent-plugin-grep](https://github.com/sonots/fluent-plugin-grep) => [fluent-plugin-parser](https://github.com/tagomoris/fluent-plugin-parser) => out_stdout chain in messages. Please notice that this plugin measures the total processing time until match chain finishes.
+Following example measures the max and average time taken to process [fluent-plugin-grep](https://github.com/sonots/fluent-plugin-grep) => out_stdout chain in messages. Please notice that this plugin measures the total processing time until match chain finishes.
```apache
+<match greped.**>
+ type stdout
+</match>
+
+<match elapsed>
+ type stdout
+</match>
+
<match **>
type elapsed_time
tag elapsed
interval 60
each message
@@ -26,26 +56,10 @@
type grep
exclude foobar
add_tag_prefix greped
</store>
</match>
-
-<match greped.**>
- type parse
- format ltsv
- key_name message
- remove_prefix greped
- add_prefix parsed
-</match>
-
-<match parsed.**>
- type stdout
-</match>
-
-<match elapsed>
- type stdout
-</match>
```
Output will be like
```
@@ -98,9 +112,17 @@
Emit 0 on the next interval. This is useful for some software which requires resetting data such as [GrowthForecast](http://kazeburo.github.io/GrowthForecast).
elapsed: {"max":1.013,"avg":0.123,"num"=>0}
# after @interval later
elapsed: {"max":0,"avg":0,"num"=>0}
+
+## Relatives
+
+* [fluent-plugin-measure_time](https://github.com/sonots/fluent-plugin-measure_time)
+
+ * This plugin make possible to measure the elapsed time of not only output plugins but also input plugins.
+ * Also, this plugin has a flexibility to measure arbitrary methods of plugins.
+ * But, this does not have flexibility of output messages such as `add_tag_prefix`, `aggregate` options because of its limitaion of internal mechanism.
## ChangeLog
See [CHANGELOG.md](CHANGELOG.md) for details.