como_client 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1ea2626e48627961305b33ae9492c2d4917358d746989985590a9d1f36662b31
4
- data.tar.gz: abf26c663f07c4e1c13ed137c52685ff94c32c4a8a48c14ac68949961c5a1cb7
3
+ metadata.gz: b863e03423ed22f67e20c70816cf3be07b3a6f952dbe7b70ab48ac57126479ae
4
+ data.tar.gz: e304d192cb318ae7616a9e013c8efa4d783e9a4ebb7b1f7b49b5f9583651759c
5
5
  SHA512:
6
- metadata.gz: 99ee9c94a971eea840de26cbdd289f3533b5977dade938a11e5ac9c4263716e7eb68e5cc86ee965776d689e9af995adc46e79032bf9d667c1e5c65496f48cafe
7
- data.tar.gz: 54b0afe5ab1e201c06740c2e981bdc02fb04ebb8ef3fecff7063467fe239e0256f5b202003dd85b2a03db8caf0e17bf6d2af639b0ab36103b7f2980862641f3a
6
+ metadata.gz: 8ff23766c274bcbe335b1a7a7f30c60abd287030972d98d3ca32e911a4af903f8fb14b3f9ec9ded4c0fc75e92ad5756bbf2aaca9b3b6788108258105eeeee07b
7
+ data.tar.gz: a5a2510903bb8c435a0d9f7f3303b67f5bf4f12e8950abfe0c880bafd1c18349f22f4c07e0812569bf82b7c7cdf57940844ee5c26387dbd55de3f91c4f96aaeb
@@ -44,7 +44,7 @@ module COMOClient
44
44
  end
45
45
 
46
46
  COMOClient::Metrics.register
47
- @pushTask = Concurrent::TimerTask.new(execution_interval: 20, timeout_interval: 20){COMOClient::Tasks::PeriodicPush.push}
47
+ @pushTask = Concurrent::TimerTask.new(execution_interval: @configuration.push_interval, timeout_interval: 20){COMOClient::Tasks::PeriodicPush.push}
48
48
  @pushTask.add_observer(COMOClient::Tasks::Observer.new)
49
49
  @pushTask.execute
50
50
  logger.info("successfully initiated metrics push service!")
@@ -11,7 +11,7 @@ module COMOClient
11
11
 
12
12
  prometheus = Prometheus::Client.registry
13
13
 
14
- hardwareGauges = Prometheus::Client::Gauge.new( :instance_metrics, docstring: 'instance hardware metrics')
14
+ hardwareGauges = Prometheus::Client::Gauge.new( :instance_metrics, docstring: 'instance hardware metrics', labels: [:hardware])
15
15
  prometheus.register(hardwareGauges)
16
16
  logger.info("registered hardware gauges")
17
17
 
@@ -25,14 +25,14 @@ module COMOClient
25
25
  usw = Usagewatch
26
26
  mem = MemInfo.new
27
27
  hardwareGauges = prometheus.get(:instance_metrics)
28
- hardwareGauges.set({ hardware: 'cpu'}, usw.uw_cpuused)
29
- hardwareGauges.set({ hardware: 'avg_load_past_minute'}, usw.uw_load)
30
- hardwareGauges.set({ hardware: 'memory_total'}, mem.memtotal)
31
- hardwareGauges.set({ hardware: 'memory_free'}, mem.memfree)
32
- hardwareGauges.set({ hardware: 'memory_used'}, mem.memused)
33
- hardwareGauges.set({ hardware: 'disk_used_perc'}, usw.uw_diskused_perc)
34
- hardwareGauges.set({ hardware: 'disk_used_gigabytes'}, usw.uw_diskused)
35
- hardwareGauges.set({ hardware: 'uptime_seconds'}, IO.read('/proc/uptime').split[0].to_i)
28
+ hardwareGauges.set(usw.uw_cpuused, labels: { hardware: 'cpu'})
29
+ hardwareGauges.set(usw.uw_load, labels: { hardware: 'avg_load_past_minute'})
30
+ hardwareGauges.set(mem.memtotal, labels: { hardware: 'memory_total'})
31
+ hardwareGauges.set(mem.memfree, labels: { hardware: 'memory_free'})
32
+ hardwareGauges.set(mem.memused, labels: { hardware: 'memory_used'})
33
+ hardwareGauges.set(usw.uw_diskused_perc, labels: { hardware: 'disk_used_perc'})
34
+ hardwareGauges.set(usw.uw_diskused, labels: { hardware: 'disk_used_gigabytes'})
35
+ hardwareGauges.set(IO.read('/proc/uptime').split[0].to_i, labels: { hardware: 'uptime_seconds'})
36
36
  logger.info("instance gauges")
37
37
 
38
38
  logger.info("updated CF metrics")
@@ -11,11 +11,11 @@ module COMOClient
11
11
  logger.info("instance: #{COMOClient.configuration.instance_name}")
12
12
  COMOClient::Metrics.update
13
13
  Prometheus::Client::Push.new(COMOClient.configuration.job_name, #job name
14
- COMOClient.configuration.instance_name,#instance name
15
- COMOClient.configuration.pushgateway_url)#pushgateway url
14
+ instance: COMOClient.configuration.instance_name,#instance name
15
+ gateway: COMOClient.configuration.pushgateway_url)#pushgateway url
16
16
  .add(Prometheus::Client.registry)
17
17
  logger.info("successfully pushed metrics")
18
18
  end
19
19
  end
20
20
  end
21
- end
21
+ end
@@ -1,3 +1,3 @@
1
1
  module COMOClient
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: como_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Disler Colin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-11 00:00:00.000000000 Z
11
+ date: 2020-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec