fluent-plugin-jfrog-metrics 0.2.1 → 0.2.2
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-jfrog-metrics.gemspec +1 -1
- data/lib/fluent/plugin/elastic_metrics_parser.rb +7 -12
- 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: d685673b8ba0be5c32b38f4b819fea0a29d568e725ea9e76c7ded7157205f1f4
|
|
4
|
+
data.tar.gz: 6e3383a0ef2fcf1cc50b78beda585c8beadb77c06bf5a9b271eb7dddc4e98c37
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 536b1b223aa79b930402f2de789c34753e38c4be9229948c4c4e790796302b9ccacb6024de3eccd288e1efae68e8bae814c5e91240793e45609cbbbe09715ecd
|
|
7
|
+
data.tar.gz: 36bc6e06fb9105defe76d927ee5d4521e43cb6d182f916a1f88432f30329627fc6b24332313e935102d99e19c3c4dc96d2eb19758b48c25d949a96021a78a1cf
|
data/Gemfile.lock
CHANGED
|
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
|
3
3
|
|
|
4
4
|
Gem::Specification.new do |spec|
|
|
5
5
|
spec.name = 'fluent-plugin-jfrog-metrics'
|
|
6
|
-
spec.version = '0.2.
|
|
6
|
+
spec.version = '0.2.2'
|
|
7
7
|
spec.authors = ['MahithaB, VasukiN, giri-vsr']
|
|
8
8
|
spec.email = ['cpe-support@jfrog.com']
|
|
9
9
|
|
|
@@ -12,22 +12,16 @@ class ElasticMetricsParser < BaseMetricsParser
|
|
|
12
12
|
def format_data(cleaned_data = [], prefix = '', separator = '')
|
|
13
13
|
hash_data_array = []
|
|
14
14
|
hash_data = {}
|
|
15
|
+
hash_data_with_labels = []
|
|
15
16
|
cleaned_data.each do |interim_data|
|
|
16
17
|
if interim_data =~ /{/ && interim_data =~ /}/
|
|
18
|
+
hash_data_with_dim_fields = {}
|
|
17
19
|
metric_name, additional_dims, metric_val_and_time = interim_data.match(/(.*){(.*)}(.*)/i).captures
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
additional_dims.split(/,/).map do |interim_dim_data|
|
|
21
|
-
additional_dim_name += '_' unless additional_dim_name.nil? || additional_dim_name.empty?
|
|
22
|
-
additional_dim_name += interim_dim_data.gsub(/"/, '').gsub(/=/, '_').gsub(/-/, '_') if interim_data =~ /=/
|
|
23
|
-
end
|
|
24
|
-
else
|
|
25
|
-
additional_dim_name = additional_dims.gsub(/"/, '').gsub(/=/, '_').gsub(/-/, '_') if interim_data =~ /=/
|
|
26
|
-
end
|
|
27
|
-
if metric_val_and_time =~ / /
|
|
28
|
-
hash_data["#{prefix}#{separator}#{metric_name}_#{additional_dim_name}"] =
|
|
29
|
-
metric_val_and_time.strip.split[0] =~ /^\S*\.\S*$/ ? metric_val_and_time.strip.split[0].to_f : metric_val_and_time.strip.split[0].to_i
|
|
20
|
+
additional_dims.split(/,/).map do |interim_dim_data|
|
|
21
|
+
hash_data_with_dim_fields[prefix + separator + interim_dim_data.split(/=/)[0]] = interim_dim_data.split(/=/)[1].gsub(/"/, '') if interim_dim_data =~ /=/
|
|
30
22
|
end
|
|
23
|
+
hash_data_with_dim_fields[prefix + separator + metric_name] = metric_val_and_time.strip.split[0] =~ /^\S*\.\S*$/ ? metric_val_and_time.strip.split[0].to_f : metric_val_and_time.strip.split[0].to_i
|
|
24
|
+
hash_data_with_labels << hash_data_with_dim_fields
|
|
31
25
|
else
|
|
32
26
|
metric_name, value, = interim_data.split
|
|
33
27
|
hash_data[prefix + separator + metric_name] =
|
|
@@ -35,5 +29,6 @@ class ElasticMetricsParser < BaseMetricsParser
|
|
|
35
29
|
end
|
|
36
30
|
end
|
|
37
31
|
hash_data_array << hash_data
|
|
32
|
+
hash_data_array << hash_data_with_labels
|
|
38
33
|
end
|
|
39
34
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fluent-plugin-jfrog-metrics
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- MahithaB, VasukiN, giri-vsr
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-03-
|
|
11
|
+
date: 2022-03-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|