fluent-plugin-elasticsearch-stats 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/fluent-plugin-elasticsearch-stats.gemspec +1 -1
- data/lib/fluent/plugin/elasticsearch_stats/base_data.rb +13 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 234253a40274d5347109bc506cac2d0c3844fd2b0d63b576848d54f4b1a661d9
|
4
|
+
data.tar.gz: 2acd56371f347a648d398d51225b6d606ca268dc2c14d00624bec705074c29da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89ca6ea1e186fb9c7fbc074dc0b5ae952de5d7bc6eadea7b79da0ef2ec89bd2fc73c08c65af9ccb2f39577d6f9244d647c28de9ea4deb8809aa6c96cb1695a81
|
7
|
+
data.tar.gz: f68f8a4b3df45c021a22f995419f430ef7e9c3918afc29b3eb78d9fcb8a3964dea71927b3f49a3fba8995838b6f53d7c3ef1824d44d9efe175cf70f39ee0cd3b
|
data/Gemfile.lock
CHANGED
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = 'fluent-plugin-elasticsearch-stats'
|
8
|
-
spec.version = '0.
|
8
|
+
spec.version = '0.4.0'
|
9
9
|
spec.authors = ['Thomas Tych']
|
10
10
|
spec.email = ['thomas.tych@gmail.com']
|
11
11
|
|
@@ -85,8 +85,10 @@ module Fluent
|
|
85
85
|
count = metric_values.size
|
86
86
|
index_base_count = count if count > index_base_count
|
87
87
|
|
88
|
+
aggregated_metric_name = pluralize_metric_name(metric_name)
|
89
|
+
|
88
90
|
if metric.aggregated_index_metrics.include?('count')
|
89
|
-
metrics << metric.format(name: [
|
91
|
+
metrics << metric.format(name: [aggregated_metric_name, 'count'],
|
90
92
|
value: count,
|
91
93
|
family: family,
|
92
94
|
metadata: local_metadata)
|
@@ -94,7 +96,7 @@ module Fluent
|
|
94
96
|
|
95
97
|
if metric.aggregated_index_metrics.include?('min')
|
96
98
|
min = metric_values.min
|
97
|
-
metrics << metric.format(name: [
|
99
|
+
metrics << metric.format(name: [aggregated_metric_name, 'min'],
|
98
100
|
value: min,
|
99
101
|
family: family,
|
100
102
|
metadata: local_metadata)
|
@@ -102,7 +104,7 @@ module Fluent
|
|
102
104
|
|
103
105
|
if metric.aggregated_index_metrics.include?('max')
|
104
106
|
max = metric_values.max
|
105
|
-
metrics << metric.format(name: [
|
107
|
+
metrics << metric.format(name: [aggregated_metric_name, 'max'],
|
106
108
|
value: max,
|
107
109
|
family: family,
|
108
110
|
metadata: local_metadata)
|
@@ -110,7 +112,7 @@ module Fluent
|
|
110
112
|
|
111
113
|
if metric.aggregated_index_metrics.include?('sum')
|
112
114
|
sum = metric_values.sum
|
113
|
-
metrics << metric.format(name: [
|
115
|
+
metrics << metric.format(name: [aggregated_metric_name, 'sum'],
|
114
116
|
value: sum,
|
115
117
|
family: family,
|
116
118
|
metadata: local_metadata)
|
@@ -118,14 +120,14 @@ module Fluent
|
|
118
120
|
|
119
121
|
if metric.aggregated_index_metrics.include?('avg')
|
120
122
|
avg = sum / count.to_f
|
121
|
-
metrics << metric.format(name: [
|
123
|
+
metrics << metric.format(name: [aggregated_metric_name, 'avg'],
|
122
124
|
value: avg,
|
123
125
|
family: family,
|
124
126
|
metadata: local_metadata)
|
125
127
|
end
|
126
128
|
end
|
127
129
|
|
128
|
-
metrics << metric.format(name: %w[
|
130
|
+
metrics << metric.format(name: %w[indices count],
|
129
131
|
value: index_base_count,
|
130
132
|
family: family,
|
131
133
|
metadata: local_metadata)
|
@@ -141,6 +143,11 @@ module Fluent
|
|
141
143
|
def indices
|
142
144
|
data['indices']
|
143
145
|
end
|
146
|
+
|
147
|
+
def pluralize_metric_name(metric_name)
|
148
|
+
metric_name.sub(/^index#{metric.name_separator}/,
|
149
|
+
"indices#{metric.name_separator}")
|
150
|
+
end
|
144
151
|
end
|
145
152
|
end
|
146
153
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-elasticsearch-stats
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Tych
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-10-
|
11
|
+
date: 2024-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bump
|