MCPcopy
hub / github.com/tornadoweb/tornado / main

Function main

maint/benchmark/chunk_benchmark.py:30–51  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28
29
30def main():
31 parse_command_line()
32 app = Application([('/', ChunkHandler)])
33 app.listen(options.port, address='127.0.0.1')
34
35 def callback(response):
36 response.rethrow()
37 assert len(response.body) == (options.num_chunks * options.chunk_size)
38 logging.warning("fetch completed in %s seconds", response.request_time)
39 IOLoop.current().stop()
40
41 logging.warning("Starting fetch with curl client")
42 curl_client = CurlAsyncHTTPClient()
43 curl_client.fetch('http://localhost:%d/' % options.port,
44 callback=callback)
45 IOLoop.current().start()
46
47 logging.warning("Starting fetch with simple client")
48 simple_client = SimpleAsyncHTTPClient()
49 simple_client.fetch('http://localhost:%d/' % options.port,
50 callback=callback)
51 IOLoop.current().start()
52
53
54if __name__ == '__main__':

Callers 1

chunk_benchmark.pyFile · 0.70

Calls 8

listenMethod · 0.95
parse_command_lineFunction · 0.90
ApplicationClass · 0.90
CurlAsyncHTTPClientClass · 0.90
currentMethod · 0.80
fetchMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected