dropsonde 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dropsonde/metrics.rb +1 -1
- data/lib/dropsonde/metrics/modules.rb +10 -7
- data/lib/dropsonde/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: a0fd6246263a8a375056fe6fdcb3bcc6b1db8cc6bddc7ea80f9dc870b48c85bc
|
4
|
+
data.tar.gz: b19a11ca730df12f61e95ae1f7bb81b9bbb65d8251966f3bcdd1fb203dacb96d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53c7d74ceb0aa6358ddb12828faf70b840a33a4bbd30977317023050833a5db24d2b72eefc1eecfc1008e6e8eae80249b93a710edc098045c333787e4faa0ef2
|
7
|
+
data.tar.gz: 6644219dfdcbf761cb2c85bf446266ddf38d343d7a84d969ae88ffb30068c5faa647393457e1e255cd5fcbc2b8acb58f52d9efcd539c5713541932df79f0a807
|
data/lib/dropsonde/metrics.rb
CHANGED
@@ -86,18 +86,21 @@ class Dropsonde::Metrics::Modules
|
|
86
86
|
if Dropsonde.puppetDB
|
87
87
|
# classes and how many nodes they're enforced on
|
88
88
|
results = Dropsonde.puppetDB.request( '',
|
89
|
-
'resources[
|
89
|
+
'resources[type, title] { type = "Class" }'
|
90
90
|
).data
|
91
91
|
|
92
|
-
# select only classes from public modules
|
93
|
-
|
94
|
-
|
92
|
+
# select only classes from public modules.
|
93
|
+
# Use uniq to reduce the iteration over very large datasets
|
94
|
+
classes = results.uniq.map do |klass|
|
95
|
+
title = klass['title']
|
96
|
+
modname = title.split('::').first.downcase
|
97
|
+
next unless modules.find {|mod| mod[:name] == modname }
|
95
98
|
|
96
99
|
{
|
97
|
-
:name =>
|
98
|
-
:count => results.count {|row| row['title'] ==
|
100
|
+
:name => title,
|
101
|
+
:count => results.count {|row| row['title'] == title},
|
99
102
|
}
|
100
|
-
end.compact
|
103
|
+
end.compact
|
101
104
|
else
|
102
105
|
classes = []
|
103
106
|
end
|
data/lib/dropsonde/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dropsonde
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Ford
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|