def parent_of?(metric)
      if new_record?
        start = (started_at - metric.started_at) * 1000.0
        start <= 0 && (start + duration >= metric.duration)
      else
        self.id == metric.parent_id
      end
    end
def parent_of?(metric)
      if new_record?
        start = (started_at - metric.started_at) * 1000.0
        start <= 0 && (start + duration >= metric.duration)
      else
        self.id == metric.parent_id
      end
    end
Returns if the current node is the parent of the given node.
 If this is a new record, we can use started_at values to detect parenting.
 However, if it was already saved, we lose microseconds information from
 timestamps and we must rely solely in id and parent_id information.