internal static CpuInfo ParseOutput([CanBeNull] string content) { var sysctl = SectionsHelper.ParseSection(content, ':'); string processorName = sysctl.GetValueOrDefault("machdep.cpu.brand_string"); var physicalProcessorCount = GetPositiveIntValue(sysctl, "hw.packages"); var physicalCoreCount = GetPositiveIntValue(sysctl, "hw.physicalcpu"); var logicalCoreCount = GetPositiveIntValue(sysctl, "hw.logicalcpu"); return(new CpuInfo(processorName, physicalProcessorCount, physicalCoreCount, logicalCoreCount)); }
internal static CpuInfo ParseOutput(string content) { var sysctl = SectionsHelper.ParseSection(content, ':'); string processorName = sysctl.GetValueOrDefault("machdep.cpu.brand_string"); var physicalProcessorCount = GetPositiveIntValue(sysctl, "hw.packages"); var physicalCoreCount = GetPositiveIntValue(sysctl, "hw.physicalcpu"); var logicalCoreCount = GetPositiveIntValue(sysctl, "hw.logicalcpu"); var nominalFrequency = GetPositiveLongValue(sysctl, "hw.cpufrequency"); var minFrequency = GetPositiveLongValue(sysctl, "hw.cpufrequency_min"); var maxFrequency = GetPositiveLongValue(sysctl, "hw.cpufrequency_max"); return(new CpuInfo(processorName, physicalProcessorCount, physicalCoreCount, logicalCoreCount, nominalFrequency, minFrequency, maxFrequency)); }