def get_max_node_memory_usage_in_percentage(self, node_name: str, duration: timedelta) -> Optional[float]:
        """
        Gets the maximal memory usage (in percentage) for the node with the given node name, in the time range between now and now - duration.
        :return: a float between 0 and 1, representing the maximal percentage of memory in use by the given node
        """

        max_memory_usage_in_percentage = self._get_max_value_in_first_series_of_query(
            f'instance:node_memory_utilisation:ratio{{job="node-exporter", job="node-exporter", instance="{node_name}"}}',
            duration,
        )
        return max_memory_usage_in_percentage

        Gets the maximal memory usage (in percentage) for the node with the given node name, in the time range between now and now - duration.
        :return: a float between 0 and 1, representing the maximal percentage of memory in use by the given node
        
src/robusta/integrations/resource_analysis/memory_analyzer.py