summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGraham Dumpleton <Graham.Dumpleton@gmail.com>2019-06-07 12:20:11 +1000
committerGraham Dumpleton <Graham.Dumpleton@gmail.com>2019-06-07 12:20:11 +1000
commit397a4e2c474d6dbf13f48d45a01d1764f371c0df (patch)
tree7728ab18c41cee9defb3c381c015175c2b06a0e9 /tests
parent2e822f7775ca3830ef077aee59abbf8d2272f331 (diff)
downloadmod_wsgi-397a4e2c474d6dbf13f48d45a01d1764f371c0df.tar.gz
Add request data and Apache request ID to request events.
Diffstat (limited to 'tests')
-rw-r--r--tests/events.wsgi17
1 files changed, 4 insertions, 13 deletions
diff --git a/tests/events.wsgi b/tests/events.wsgi
index 6d7dfb0..50b9246 100644
--- a/tests/events.wsgi
+++ b/tests/events.wsgi
@@ -20,23 +20,14 @@ def wrapper(application):
def event_handler(name, **kwargs):
print('EVENT', name, kwargs, os.getpid(), mod_wsgi.application_group)
if name == 'request_started':
- request = mod_wsgi.request_data()
- print('REQUEST', request)
- environ = kwargs['request_environ']
- start_time = time.time()
- request['start_time'] = start_time
thread = threading.current_thread()
- request['thread_name'] = thread.name
- request['thread_id'] = thread.ident
+ request_data = kwargs['request_data']
+ request_data['thread_name'] = thread.name
+ request_data['thread_id'] = thread.ident
return dict(application_object=wrapper(kwargs['application_object']))
elif name == 'response_started':
- request = mod_wsgi.request_data()
- print('CONTENT', request)
- print('ACTIVE', mod_wsgi.active_requests)
+ print('REQUESTS', mod_wsgi.active_requests)
elif name == 'request_finished':
- request = mod_wsgi.request_data()
- print('REQUEST', request)
- print('FINISH', time.time()-request['start_time'])
print('PROCESS', mod_wsgi.process_metrics())
elif name == 'request_exception':
exception_info = kwargs['exception_info']