def look_after(self):

        def handle_response(response, *args, **kwargs):
            if response.error:
                self.statsd.increment("http_stats.error")
                self.statsd.increment("http_stats.error.%s" % response.code)
                if self.restart_on_error:
                    self.cast("restart", name=self.restart_on_error)
                    self.statsd.increment("http_stats.restart_on_error")
                return

            self.statsd.timed("http_stats.request_time",
                              int(response.request_time * 1000))

        self.http_client.fetch(self.check_url, handle_response,
                               request_timeout=self.timeout)
dataset/ETHPy150Open circus-tent/circus/circus/plugins/http_observer.py/HttpObserver.look_after/original