Created
July 18, 2012 22:21
-
-
Save GrahamDumpleton/3139309 to your computer and use it in GitHub Desktop.
Test that RUM header/footer are being output.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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