fluent-plugin-jfrog-metrics 0.2.5 → 0.2.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b2ae50efd3530bcd0b047c79aca24ee8509c76c972fe834bd2092a55b0d9f807
4
- data.tar.gz: 5eb9ead9094b261942d23f8e7181913b41bb08326fb5ec86cc784a29dafd5328
3
+ metadata.gz: b93ecb5ecea1f1ab7144d5f1032951346c68427c6f2797a9c1799562ab609835
4
+ data.tar.gz: baa93977ee4ee4015fa1779a3d2c7ae4dc442e1084b730d944e5820664a1ff40
5
5
  SHA512:
6
- metadata.gz: 3bde97c36506f91725cc8a13fae533929a6d6bb461822f701095e205e96c421e10df47213b94e3c7b12cc284880ff7361eb401202b84acf07bb16c781ccd42e5
7
- data.tar.gz: 8b5096c569210002908e19f416a5e605ece7d26e725037e10c2d9c57be06a28624bb0456d4dcaed8afee732c3bbd1c9bc77ebde1782bb571f3ebc577e12ae9c0
6
+ metadata.gz: e6fc16c13405a355a325f4bd91e0be810e7b84325fdacb638ffa5403c3a6e1fff3d4914231916378d484725f439903ea0e720f5b62c9d6e1270d5f9c867dd871
7
+ data.tar.gz: d50066d93ceec87c01396a5730531d6bc0018fe50c6ba3f63c62832db5db38009c22b0d1d0a8773c959625b0aa46885ab26e21601d3ac0036079c230993b32cf
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fluent-plugin-jfrog-metrics (0.2.5)
4
+ fluent-plugin-jfrog-metrics (0.2.6)
5
5
  fluentd (>= 0.14.10, < 2)
6
6
  rest-client (~> 2.0)
7
7
 
@@ -10,7 +10,7 @@ GEM
10
10
  specs:
11
11
  ansi (1.5.0)
12
12
  builder (3.2.4)
13
- concurrent-ruby (1.2.2)
13
+ concurrent-ruby (1.1.9)
14
14
  cool.io (1.7.1)
15
15
  domain_name (0.5.20190701)
16
16
  unf (>= 0.0.5, < 1.0.0)
@@ -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.5'
6
+ spec.version = '0.2.6'
7
7
  spec.authors = ['MahithaB, VasukiN, giri-vsr']
8
8
  spec.email = ['cpe-support@jfrog.com']
9
9
 
@@ -36,7 +36,7 @@ class DatadogMetricsParser < BaseMetricsParser
36
36
  if metric_val_and_time =~ / /
37
37
  metrics_hash['metric'] = prefix + separator + metric_name
38
38
  metric_timestamp = metric_val_and_time.strip.split[1]
39
- point['timestamp'] = metric_timestamp[0,10].to_i
39
+ point['timestamp'] = metric_timestamp[0,10].to_i if metric_timestamp != nil
40
40
  point['value'] = 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
41
41
  points << point
42
42
  metrics_hash['points'] = points
@@ -37,7 +37,8 @@ module Fluent
37
37
  config_param :username, :string, default: ''
38
38
  config_param :apikey, :string, default: '', :secret => true
39
39
  config_param :token, :string, default: '', :secret => true
40
- config_param :interval, :time, default: 10
40
+ config_param :execution_interval, :time, default: 10
41
+ config_param :timeout_interval, :time, default: 30
41
42
  config_param :metric_prefix, :string, default: ''
42
43
  config_param :target_platform, :string, default: 'SPLUNK'
43
44
  config_param :common_jpd, :bool, default: false
@@ -55,8 +56,6 @@ module Fluent
55
56
 
56
57
  raise Fluent::ConfigError, 'Must define the apikey or token for authentication.' if @token == '' && @apikey == ''
57
58
 
58
- raise Fluent::ConfigError, 'Must define the interval to use for gathering the metrics.' if @interval == ''
59
-
60
59
  raise Fluent::ConfigError, 'Must define the metric_prefix to use for getting the metrics.' if @metric_prefix == ''
61
60
 
62
61
  raise Fluent::ConfigError, 'Must define the vendor to use for getting the metrics.' if @target_platform == ''
@@ -77,17 +76,19 @@ module Fluent
77
76
 
78
77
  def run
79
78
  puts('Preparing metrics collection, creating timer task')
80
- timer_task = Concurrent::TimerTask.new(execution_interval: @interval, timeout_interval: 30, run_now: true) do
79
+ timer_task = Concurrent::TimerTask.new(execution_interval: @execution_interval, timeout_interval: @timeout_interval, run_now: true) do
81
80
  puts('Timer task execution')
82
81
  do_execute
83
82
  end
84
83
  timer_task.execute
84
+ sleep 100
85
85
  end
86
86
 
87
87
  def do_execute
88
88
  puts('Executing metrics collection')
89
89
  metrics_helper = MetricsHelper.new(@metric_prefix, @jpd_url, @username, @apikey, @token, @common_jpd)
90
90
  platform_metrics = metrics_helper.get_metrics
91
+
91
92
  additional_metrics = metrics_helper.get_additional_metrics
92
93
  if !additional_metrics.nil? && additional_metrics != ''
93
94
  platform_metrics += additional_metrics.to_s
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.5
4
+ version: 0.2.6
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: 2023-06-14 00:00:00.000000000 Z
11
+ date: 2024-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler