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 +4 -4
- data/lib/como_client.rb +1 -1
- data/lib/como_client/metrics/cf.rb +9 -9
- data/lib/como_client/tasks/periodic_push.rb +3 -3
- data/lib/como_client/version.rb +1 -1
- 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: b863e03423ed22f67e20c70816cf3be07b3a6f952dbe7b70ab48ac57126479ae
|
4
|
+
data.tar.gz: e304d192cb318ae7616a9e013c8efa4d783e9a4ebb7b1f7b49b5f9583651759c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ff23766c274bcbe335b1a7a7f30c60abd287030972d98d3ca32e911a4af903f8fb14b3f9ec9ded4c0fc75e92ad5756bbf2aaca9b3b6788108258105eeeee07b
|
7
|
+
data.tar.gz: a5a2510903bb8c435a0d9f7f3303b67f5bf4f12e8950abfe0c880bafd1c18349f22f4c07e0812569bf82b7c7cdf57940844ee5c26387dbd55de3f91c4f96aaeb
|
data/lib/como_client.rb
CHANGED
@@ -44,7 +44,7 @@ module COMOClient
|
|
44
44
|
end
|
45
45
|
|
46
46
|
COMOClient::Metrics.register
|
47
|
-
@pushTask = Concurrent::TimerTask.new(execution_interval:
|
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'}
|
29
|
-
hardwareGauges.set({ hardware: 'avg_load_past_minute'}
|
30
|
-
hardwareGauges.set({ hardware: 'memory_total'}
|
31
|
-
hardwareGauges.set({ hardware: 'memory_free'}
|
32
|
-
hardwareGauges.set({ hardware: 'memory_used'}
|
33
|
-
hardwareGauges.set({ hardware: 'disk_used_perc'}
|
34
|
-
hardwareGauges.set({ hardware: 'disk_used_gigabytes'}
|
35
|
-
hardwareGauges.set(
|
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
|
data/lib/como_client/version.rb
CHANGED
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.
|
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:
|
11
|
+
date: 2020-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|