def ProcessClientResourcesStats(self, client_id, status):
    """Process status message from a client and update the stats.

    Args:
      client_id: Client id.
      status: The status object returned from the client.
    """
    if hasattr(status, "child_session_id"):
      flow_path = status.child_session_id
    else:
      flow_path = "aff4:/%s/flows/%s" % (status.client_id, status.flow_id)

    resources = rdf_client_stats.ClientResources()
    resources.client_id = client_id
    resources.session_id = flow_path
    resources.cpu_usage.user_cpu_time = status.cpu_time_used.user_cpu_time
    resources.cpu_usage.system_cpu_time = status.cpu_time_used.system_cpu_time
    resources.network_bytes_sent = status.network_bytes_sent
    self.context.usage_stats.RegisterResources(resources)
def ProcessClientResourcesStats ( self , client_id , status ) : if hasattr ( status , "child_session_id" ) : flow_path = status . child_session_id else : flow_path = "aff4:/%s/flows/%s" % ( status . client_id , status . flow_id ) resources = rdf_client_stats . ClientResources ( ) resources . client_id = client_id resources . session_id = flow_path resources . cpu_usage . user_cpu_time = status . cpu_time_used . user_cpu_time resources . cpu_usage . system_cpu_time = status . cpu_time_used . system_cpu_time resources . network_bytes_sent = status . network_bytes_sent self . context . usage_stats . RegisterResources ( resources )
Process status message from a client and update the stats.

    Args:
      client_id: Client id.
      status: The status object returned from the client.