Skip to content

Instantly share code, notes, and snippets.

@GrahamDumpleton
Created July 18, 2012 22:21
Show Gist options
  • Save GrahamDumpleton/3139309 to your computer and use it in GitHub Desktop.
Save GrahamDumpleton/3139309 to your computer and use it in GitHub Desktop.
Test that RUM header/footer are being output.
import newrelic.agent
newrelic.agent.register_application(timeout=10.0)
def start_response(status, headers): pass
@newrelic.api.web_transaction.wsgi_application()
def handler(environ, start_response):
status = '200 OK'
output = 'Hello World!'
response_headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, response_headers)
print 'HEADER', newrelic.agent.get_browser_timing_header()
print 'FOOTER', newrelic.agent.get_browser_timing_footer()
return [output]
environ = { 'REQUEST_URI': '/test' }
handler(environ, start_response).close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment