Beispiel #1
0
    def flush_batch(self, batch):
        batch.sort(key=lambda msg: msg.get("project_id", 0) or 0)

        with batch_buffers_incr():
            with BaseManager.local_cache():
                for _ in self.pool.imap_unordered(_process_message_with_timer,
                                                  batch,
                                                  chunksize=100):
                    pass
Beispiel #2
0
    def flush_batch(self, batch):
        batch.sort(key=lambda msg: msg.get("project_id", 0) or 0)

        with metrics.timer("outcomes_consumer.process_tsdb_batch"):
            _process_tsdb_batch(batch)

        with metrics.timer("outcomes_consumer.process_signal_batch"):
            with batch_buffers_incr():
                with BaseManager.local_cache():
                    for _ in self.pool.imap_unordered(
                            _process_signal_with_timer, batch, chunksize=100):
                        pass