def get_process_stats_rows(raw_process_stats):
  """
  Obtains useful information from process statistics and returns:
  PRIVATE IP, MONIT NAME, UNIQUE MEMORY (MB), CPU (%) values.

  Args:
    raw_process_stats: A dict in which each key is an ip and value is a dict
      of useful information.

  Returns:
    A list of process statistics headers.
    A list of process statistics.
  """
  process_stats_headers = [
    "PRIVATE IP", "MONIT NAME", "MEM MB", "CPU%"
  ]

  process_stats = []
  for ip, node in raw_process_stats.iteritems():
    stat = node["processes_stats"]
    for proc in stat:
      memory_unique = int(proc["memory"]["unique"])
      cpu_percent = float(proc["cpu"]["percent"])
      if proc["children_num"] > 0:
        child = proc["children_stats_sum"]
        memory_unique += int(child["memory"]["unique"])
        cpu_percent += float(child["cpu"]["percent"])
      process_stats.append([
        ip,
        proc["monit_name"],
        memory_unique / 1024 / 1024,  # row[2] from B to MB
        cpu_percent
      ])

  return process_stats_headers, process_stats