Refactored similar code into OvirtMetrics.metrics_to_hashes