def query_fragment_metric_by_node_id(node, metric_name):
  """
  Given the surragate node id (i.e. unique id of the plan node in the database),
  return the value of the fragment level metric.
  :param node_id:
  :param metric_name:
  :return: the value of the metric; none if there is no result
  """
  metrics = node.find_metric_by_name(metric_name)
  return metrics[0]['value'] if metrics else None