func findPowerProfile()

in internal/guestcollector/linux_guestcollector.go [429:440]


func findPowerProfile(powerProfileFull string) (string, error) {
	powerProfile := strings.Split(powerProfileFull, ": ")

	if len(powerProfile) < 2 || powerProfile[0] != "Current active profile" {
		return "", fmt.Errorf(`Check help docs. Expected power profile format to be  "Current active profile: <profile>. Actual result: ` + powerProfileFull)
	}
	if HighPerformanceProfiles()[powerProfile[1]] {
		return "High performance", nil
	}

	return powerProfile[1], nil
}