def collect(self, spanID, *annotations): self._log("collecting", str(len(annotations)), "annotations for", str(spanID)) packet = encode._collect(spanID, *annotations) buf = encode._msg(packet) totalSent = 0 while totalSent < len(buf): sent = self.sock.send(buf[totalSent:]) if sent == 0: raise RuntimeError("socket connection broken") totalSent = totalSent + sent
def collect(self, spanID, *annotations): self._log("collecting", str(len(annotations)), "annotations for", str(spanID)) # Append the collection packet to the pending queue. self._pending.append(encode._collect(spanID, *annotations))