lib/facter/resolvers/solaris/processors.rb in facter-4.1.0 vs lib/facter/resolvers/solaris/processors.rb in facter-4.1.1
- old
+ new
@@ -26,9 +26,16 @@
def parse_output(output)
@fact_list[:logical_count] = output.scan(/module/).size
@fact_list[:physical_count] = output.scan(/chip_id .*/).uniq.size
@fact_list[:speed] = output.scan(/current_clock_Hz .*/).first.gsub(/[a-zA-z\s]+/, '').to_i
@fact_list[:models] = output.scan(/brand .*/).map { |elem| elem.gsub(/brand(\s+)/, '') }
+ calculate_threads_cores(output)
+ end
+
+ def calculate_threads_cores(output)
+ @fact_list[:core_count] = output.scan(/\score_id .*/).uniq.size
+ @fact_list[:threads_per_core] = @fact_list[:logical_count] / @fact_list[:core_count]
+ @fact_list[:cores_per_socket] = @fact_list[:core_count] / @fact_list[:physical_count]
end
end
end
end
end