Commit eeb384e
metrics: enable input metrics by default (#4966)
**Which issue(s) this PR fixes**:
Fixes #
**What this PR does / why we need it**:
I ran fluend with `--enable-input-metrics` option and read 10GB file
with the `in_tail` plugin
There was no significant performance degradation.
So, I think it is safe to always enable `--enable-input-metrics`.
### environment
* ruby 3.4.3 (2025-04-14 revision d0b7e5b6a0) +PRISM [x86_64-linux]
### results
* fluentd master branch (efbb51d)
* `ruby bin/fluentd -c in_tail.conf`
* 65.939232375 seconds
* `ruby bin/fluentd --enable-input-metrics -c in_tail.conf`
* 67.776236261 seconds
* fluentd 1.16.9 (daccbc6)
* `ruby bin/fluentd -c in_tail.conf`
* 106.312500419 seconds
### config
```
<source>
@type tail
tag test
path "#{File.expand_path '~/tmp/fluentd/access-*.log'}"
read_from_head true
<parse>
@type json
</parse>
</source>
<match **>
@type file
path "#{File.expand_path '~/tmp/fluentd/log'}"
</match>
```
### script to generate 10GB
```ruby
# frozen_string_literal: true
require "json"
require "fileutils"
def data_generater(str)
{
"message": str * 1000,
}.to_json
end
FILE_MAX_SIZE = 10 * 1024 * 1024 * 1024
FILE_PATH = "/home/watson/tmp/fluentd/access-1.log"
dir = File.dirname(FILE_PATH)
FileUtils.mkdir_p(dir)
File.open(FILE_PATH, "w") do |f|
data = data_generater('a')
loop do
f.puts data
break if File.size(FILE_PATH) > FILE_MAX_SIZE
end
end
```
**Docs Changes**:
fluent/fluentd-docs-gitbook#578
**Release Note**:
The same as the title.
---------
Signed-off-by: Shizuo Fujita <[email protected]>
Co-authored-by: Daijiro Fukuda <[email protected]>1 parent a3f4c82 commit eeb384e
File tree
8 files changed
+21
-6
lines changed- lib/fluent
- command
- test
- command
- config
8 files changed
+21
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
159 | 163 | | |
160 | 164 | | |
161 | 165 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
631 | 631 | | |
632 | 632 | | |
633 | 633 | | |
634 | | - | |
| 634 | + | |
635 | 635 | | |
636 | 636 | | |
637 | 637 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1608 | 1608 | | |
1609 | 1609 | | |
1610 | 1610 | | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
1611 | 1619 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
| |||
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
| 107 | + | |
106 | 108 | | |
107 | 109 | | |
108 | 110 | | |
| |||
0 commit comments