def post_request(self, sender, **kwargs):
        url = kwargs['url']

        new_query_counts = [(c.alias, c.dtu_query_count) for c in connections.all()]

        deltas = {}
        for k, v in new_query_counts:
            # Skip inactive connections:
            delta = v - self.query_counts[url][k]
            if delta > 0:
                deltas[k] = delta

        for k, v in sorted(deltas.items(), reverse=True):
            if v > 50:
                log_f = LOG.critical
            elif v > 20:
                log_f = LOG.error
            elif v > 10:
                log_f = LOG.warning
            else:
                log_f = LOG.info
            log_f("%s: %s %d queries", url, k, v)

        if self.csv_writer:
            self.csv_writer.writerow((url, sum(deltas.values())))
dataset/ETHPy150Open ericholscher/django-test-utils/test_utils/crawler/plugins/query_count.py/QueryCount.post_request/original