ÿØÿàJFIFÿþ ÿÛC       ÿÛC ÿÀÿÄÿÄ"#QrÿÄÿÄ&1!A"2qQaáÿÚ ?Øy,æ/3JæÝ¹È߲؋5êXw²±ÉyˆR”¾I0ó2—PI¾IÌÚiMö¯–þrìN&"KgX:Šíµ•nTJnLK„…@!‰-ý ùúmë;ºgµŒ&ó±hw’¯Õ@”Ü— 9ñ-ë.²1<yà‚¹ïQÐU„ہ?.’¦èûbß±©Ö«Âw*VŒ) `$‰bØÔŸ’ëXÖ-ËTÜíGÚ3ð«g Ÿ§¯—Jx„–’U/ÂÅv_s(Hÿ@TñJÑãõçn­‚!ÈgfbÓc­:él[ðQe 9ÀPLbÃãCµm[5¿ç'ªjglå‡Ûí_§Úõl-;"PkÞÞÁQâ¼_Ñ^¢SŸx?"¸¦ùY騐ÒOÈ q’`~~ÚtËU¹CڒêV  I1Áß_ÿÙ aNc@sdZddlZddlZddlZddlZddlmZddlmZddl m Z ddl m Z m Z ddlmZmZedd d Zd efd YZd ZdgZdZdZdZedZeje_ddZdS(sv Watches the key ``paste.httpserver.thread_pool`` to see how many threads there are and report on any wedged threads. iN(tStringIO(t get_ident(thttpexceptions(t construct_urltparse_formvars(t HTMLTemplatetbunchsv {{title}}

{{title}}

{{if kill_thread_id}}
Thread {{kill_thread_id}} killed
{{endif}}
Pool size: {{nworkers}} {{if actual_workers > nworkers}} + {{actual_workers-nworkers}} extra {{endif}} ({{nworkers_used}} used including current request)
idle: {{len(track_threads["idle"])}}, busy: {{len(track_threads["busy"])}}, hung: {{len(track_threads["hung"])}}, dying: {{len(track_threads["dying"])}}, zombie: {{len(track_threads["zombie"])}}
{{for thread in threads}}
Thread {{if thread.thread_id == this_thread_id}} (this request) {{endif}} {{thread.thread_id}} {{if allow_kill}}
{{endif}}
Time processing request {{thread.time_html|html}}
URI {{if thread.uri == 'unknown'}} unknown {{else}}{{thread.uri_short}} {{endif}}
▸ Show environ {{if thread.traceback}} ▸ Show traceback {{endif}}
{{endfor}} tnameswatchthreads.page_templatet WatchThreadscBs5eZdZedZdZdZdZRS(si Application that watches the threads in ``paste.httpserver``, showing the length each thread has been working on a request. If allow_kill is true, then you can kill errant threads through this application. This application can expose private information (specifically in the environment, like cookies), so it should be protected. cCs ||_dS(N(t allow_kill(tselfR ((sI/opt/alt/python27/lib/python2.7/site-packages/paste/debug/watchthreads.pyt__init__scCs\d|kr#|ddgdgS|jddkrH|j||S|j||SdS( Nspaste.httpserver.thread_pools 403 Forbiddens Content-types text/plainsCYou must use the threaded Paste HTTP server to use this applicationt PATH_INFOs/kill(s Content-types text/plain(tgettkilltshow(R tenvirontstart_response((sI/opt/alt/python27/lib/python2.7/site-packages/paste/debug/watchthreads.pyt__call__s  cCs|ddgt|}|jdr8|d}nd}|d}|j}tj}|jj}|jddg} x|D]\} \} } t} | j | | rt | | _ n d| _ | | _ t || | _t| j | _| | _t| | _qWtjd d d |d t|jd t|d|dd|d|jd| dtd|j }|gS(Ns200 OKs Content-types text/htmlRspaste.httpserver.thread_pooltkeycSs |ddS(Nii((tv((sI/opt/alt/python27/lib/python2.7/site-packages/paste/debug/watchthreads.pytttunknownttitlesThread Pool Worker Trackertnworkerstactual_workerst nworkers_usedt script_namet SCRIPT_NAMEtkill_thread_idR tthreadstthis_thread_idt track_threads(s Content-types text/html(RR tNoneRttimetworker_trackertitemstsortRtappendRturit thread_idt format_timet time_htmltshortent uri_shortRttraceback_threadt tracebackt page_templatet substitutetlentworkersR RR!(R RRtformRt thread_poolRtnowR3RR)t time_startedtworker_environtthreadtpage((sI/opt/alt/python27/lib/python2.7/site-packages/paste/debug/watchthreads.pyRsD               cCs|js%tjd}|||St|}t|d}|d}||jkrztjd|}|||S|j||dpd}tjdd|d |fg}|||S( Ns?Killing threads has not been enabled. Shame on you for trying!R)spaste.httpserver.thread_poolsBYou tried to kill thread %s, but it is not working on any requestsRt/theaderstLocations?kill=%s( R Rt HTTPForbiddenRtintR$tPreconditionFailedt kill_workert HTTPFound(R RRtexctvarsR)R5R((sI/opt/alt/python27/lib/python2.7/site-packages/paste/debug/watchthreads.pyRs"         (t__name__t __module__t__doc__tFalseR RRR(((sI/opt/alt/python27/lib/python2.7/site-packages/paste/debug/watchthreads.pyRs    *cCs_ttdsdStj}||kr/dS||}t}tj|d||jS(sf Returns a plain-text traceback of the given thread, or None if it can't get a traceback. t_current_framestfileN(thasattrtsysR"RIRR/t print_stacktgetvalue(R)tframestframetout((sI/opt/alt/python27/lib/python2.7/site-packages/paste/debug/watchthreads.pyR.s    spaste.httpserver.thread_poolc Cs|dkr"tjddddSg}xt|jD]\}}|tkrYq;nyb|j|kr}t|}n|jtjdt j t |dt j t |Wq;t k r}|jtjdt j t |dd|q;Xq;Wdj |S(NRs---tvalues-No environment registered for this thread yets Error in repr(): %sR(R"tenviron_templateR1tsortedR%t hide_keystuppertreprR'tcgitescapetstrt Exceptiontjoin(Rt environ_rowsRRRte((sI/opt/alt/python27/lib/python2.7/site-packages/paste/debug/watchthreads.pytformat_environs*     cCs|d krBdt|ddt|dd|df}ni|dkrodt|d|df}n<|dkrd|}n#|dkrd|}n d|}|d kr|S|dkrd |Sd |SdS( Ni<s %i:%02i:%02iixs%i:%02is%i secis %0.1f secs %0.2f secis#%ss;%si(R?(t time_lengtht time_string((sI/opt/alt/python27/lib/python2.7/site-packages/paste/debug/watchthreads.pyR*,s"         cCs.t|dkr&|d d|dS|SdS(Ni<i(s...i(R2(ts((sI/opt/alt/python27/lib/python2.7/site-packages/paste/debug/watchthreads.pyR,BscCs#ddlm}td||S(Ni(tasboolR (tpaste.deploy.convertersRcR(t global_confR Rc((sI/opt/alt/python27/lib/python2.7/site-packages/paste/debug/watchthreads.pytmake_watch_threadsHsicstfd}|S(Ncsvddl}r"tjn9d}x0d||jfGHtjd|d7}q+W|dd gd gS( NiisI'm alive %s (%s)i is200 OKs content-types text/plainsOK, paused %s seconds(s content-types text/plain(R9R#tsleepR(RRR9tcount(tpause(sI/opt/alt/python27/lib/python2.7/site-packages/paste/debug/watchthreads.pytbad_appOs  (R?(ReRiRj((RisI/opt/alt/python27/lib/python2.7/site-packages/paste/debug/watchthreads.pyt make_bad_appMs  (RGRLRXR#R/t cStringIORR9RtpasteRt paste.requestRRtpaste.util.templateRRR0tobjectRR.RUR_R*R,RHRfRk(((sI/opt/alt/python27/lib/python2.7/site-packages/paste/debug/watchthreads.pyts(    W