code: def WriteClientSnapshot(self, snapshot):
      
      client_id = snapshot.client_id
  
      if client_id not in self.metadatas:
        raise db.UnknownClientError(client_id)
  
      startup_info = snapshot.startup_info
      snapshot.startup_info = None
  
      ts = rdfvalue.RDFDatetime.Now()
      history = self.clients.setdefault(client_id, {})
      history[ts] = snapshot.SerializeToString()
  
      history = self.startup_history.setdefault(client_id, {})
      history[ts] = startup_info.SerializeToString()
  
      snapshot.startup_info = startup_info
docs: Writes new client snapshot.