Read/calculate hunt client resources stats.

def ReadHuntClientResourcesStats(self, hunt_id):
    """Read/calculate hunt client resources stats."""

    result = rdf_stats.ClientResourcesStats()
    for f in self._GetHuntFlows(hunt_id):
      cr = rdf_client_stats.ClientResources(
          session_id="%s/%s" % (f.client_id, f.flow_id),
          client_id=f.client_id,
          cpu_usage=f.cpu_time_used,
          network_bytes_sent=f.network_bytes_sent)
      result.RegisterResources(cr)

    # TODO(user): remove this hack when compatibility with AFF4 is not
    # important.
    return rdf_stats.ClientResourcesStats.FromSerializedString(
        result.SerializeToString())