1. Jason Pellerin
  2. dozer


Marius Gedminas  committed 74c83f5

Stick the thread id into the environment.

It's useful to see if two requests were processed by the same thread or not.
I'm not very happy about abusing the environment thus, but I'm not sure where
else to stick it.

  • Participants
  • Parent commits 6b68844
  • Branches trunk

Comments (0)

Files changed (1)

File dozer/profile.py

View file
  • Ignore whitespace
 import time
 import os
 import re
+import thread
 from datetime import datetime
 from pkg_resources import resource_filename
                        'QUERY_STRING', 'CONTENT_TYPE', 'CONTENT_LENGTH',
                        'SERVER_NAME', 'SERVER_PORT', 'SERVER_PROTOCOL']:
                 safe_environ[k] = v
+        safe_environ['thread_id'] = str(thread.get_ident())
         profile_run = dict(time=datetime.now(), profile=tree,
         fname_base = str(time.time()).replace('.', '_')