Method: OpenNebula.process_monitoring
- Defined in:
- lib/opennebula/pool_element.rb
.process_monitoring(xmldoc, root_elem, timestamp_elem, oid, xpath_expressions) ⇒ Hash<String, Array<Array<int>>, OpenNebula::Error] Hash with the requested xpath expressions, and an Array of [timestamp, value].
Processes the monitoring data in XML returned by OpenNebula
272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
# File 'lib/opennebula/pool_element.rb', line 272 def self.process_monitoring(xmldoc, root_elem, , oid, xpath_expressions) hash = {} = xmldoc.retrieve_elements( "#{root_elem}[ID=#{oid}]/#{}") xpath_expressions.each { |xpath| xpath_values = xmldoc.retrieve_elements("#{root_elem}[ID=#{oid}]/#{xpath}") if ( xpath_values.nil? ) hash[xpath] = [] else hash[xpath] = .zip(xpath_values) end } return hash end |