Skip to content
This repository has been archived by the owner on Dec 22, 2020. It is now read-only.

globocom/tornado-measures

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tornado-measures

Simple Tornado HTTP Client that automatically sends http response metrics to Backstage measures

Example

from tornado.ioloop import IOLoop
from tornado import gen
from tornado_measures import setup_measures
from tornado.httpclient import AsyncHTTPClient

setup_measures(
    client='MyApplicationName',
    address=('host', 1984), # logstash host and port
    # optional: if you want to use pycurl instead default tornado client
    client_class = 'tornado.curl_httpclient.CurlAsyncHTTPClient' 
)
# don't use AsyncHTTPClient.configure anymore
http_client = AsyncHTTPClient()


@gen.coroutine
def blah():
    response = yield http_client.fetch(
        "http://globo.com/", raise_error=True)

blah()
IOLoop.current().start()

About

Simple Tornado HTTP Client that sends metrics to Backstage measures

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published