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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0ac6f28ed9d64982c400f6a7460b57f44396020e6f17f04f587cc6e5007ff115
4
- data.tar.gz: ef5a2ac1957b4b45c756b0e4bbc5ae66291706afabd3a7b80e899702f8aa6757
3
+ metadata.gz: a0fd6246263a8a375056fe6fdcb3bcc6b1db8cc6bddc7ea80f9dc870b48c85bc
4
+ data.tar.gz: b19a11ca730df12f61e95ae1f7bb81b9bbb65d8251966f3bcdd1fb203dacb96d
5
5
  SHA512:
6
- metadata.gz: d9bda687091ec5a1d6bd8ca7e5f1414e2c489e3a1c66a970b879d7f6a2d6ab82e11f079eebfea13ed7a710ebe20b4c0aefd0a08f1af17547e3a5cd120c587847
7
- data.tar.gz: e96d699c38c0d158bce376f13d77d9bafa3ef5d4020e104d32694df04fcc68c91bb458d2bb858f9d120dc5b9146ffd3bfde450535cfe0b971b331b349e7dc78b
6
+ metadata.gz: 53c7d74ceb0aa6358ddb12828faf70b840a33a4bbd30977317023050833a5db24d2b72eefc1eecfc1008e6e8eae80249b93a710edc098045c333787e4faa0ef2
7
+ data.tar.gz: 6644219dfdcbf761cb2c85bf446266ddf38d343d7a84d969ae88ffb30068c5faa647393457e1e255cd5fcbc2b8acb58f52d9efcd539c5713541932df79f0a807
@@ -51,7 +51,7 @@ class Dropsonde::Metrics
51
51
  schema = plugin.schema
52
52
 
53
53
  plugin.setup
54
- data = sanity_check_data(plugin)
54
+ data = sanity_check_data(plugin, plugin.run)
55
55
  plugin.cleanup
56
56
 
57
57
  str << plugin.name+"\n"
@@ -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[certname, type, title] { type = "Class" }'
89
+ 'resources[type, title] { type = "Class" }'
90
90
  ).data
91
91
 
92
- # select only classes from public modules
93
- classes = results.map do |klass|
94
- next unless modules.find {|mod| mod[:name] == klass['title'].split('::').first.downcase }
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 => klass['title'],
98
- :count => results.count {|row| row['title'] == klass['title']},
100
+ :name => title,
101
+ :count => results.count {|row| row['title'] == title},
99
102
  }
100
- end.compact.uniq
103
+ end.compact
101
104
  else
102
105
  classes = []
103
106
  end
@@ -1,3 +1,3 @@
1
1
  class Dropsonde
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
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.3
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-24 00:00:00.000000000 Z
11
+ date: 2020-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json