def get_total_cpu_usage(self, other_method=False):
        """
        Gets the total cpu usage for the node, including both containers and everything running on the host directly
        :return: a float between 0 and 1 representing the percentage of total cpus used
        """
        if other_method:
            return self._query(
                f'rate(container_cpu_usage_seconds_total{{node="{self.node.metadata.name}",pod="",id="/"}}[{self.range_size}]) '
                f'/ scalar(sum (machine_cpu_cores{{node="{self.node.metadata.name}"}}))'
            )

        # the instance here refers to the node as identified by its internal IP
        # we average by the instance to account for multiple cpus and still return a number between 0-1
        return self._query(
            f"1"
            f"- avg by(instance)(rate("
            f'   node_cpu_seconds_total{{mode=~"idle", instance=~"{self.node.metadata.name}|{self.internal_ip}:.*"}}[{self.range_size}]'
            f"))"
            f"- avg by(instance)(rate("
            f'   node_cpu_seconds_total{{mode=~"iowait", instance=~"{self.node.metadata.name}|{self.internal_ip}:.*"}}[{self.range_size}]'
            f"))"
        )

        Gets the total cpu usage for the node, including both containers and everything running on the host directly
        :return: a float between 0 and 1 representing the percentage of total cpus used
        
src/robusta/integrations/resource_analysis/node_cpu_analyzer.py