-í
G°w=c       sÿ   d  Z  d k Z d k Z d k Z d k Z d k Z d k Z d k Z d k Z d k	 Z	 d k
 Z d k Z d k l Z d k l Z d e	 i f d „  ƒ  YZ d Z d e i f d „  ƒ  YZ e d	 „ Z d
 „  Z d „  Z e d j o e e i d ƒ n d S(   sÄ  Test speed of a ZODB storage

Options:

    -d file    The data file to use as input.
               The default is this script.

    -n n       The number of repititions

    -s module  A module that defines a 'Storage'
               attribute, which is an open storage.
               If not specified, a FileStorage will ne
               used.

    -z         Test compressing data

    -D         Run in debug mode

    -L         Test loads as well as stores by minimizing
               the cache after eachrun

    -M         Output means only

    -C         Run with a persistent client cache

    -U         Run ZEO using a Unix domain socket

    -t n       Number of concurrent threads to run.
N(   s   forker(   s   ConflictErrors   Pc      s   t  Z RS(   N(   s   __name__s
   __module__(    (    (    s7   /usr/pkg/lib/python2.2/site-packages/ZEO/tests/speed.pys   P6 s   s   zeo-speed.fss   ZEOExitc      s;   t  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   s/   Used to exit ZEO.StorageServer when run is donec    s   d Sd  S(   Ni    (    (   s   self(    (    s7   /usr/pkg/lib/python2.2/site-packages/ZEO/tests/speed.pys   writable= s    c    s   d Sd  S(   Ni   (    (   s   self(    (    s7   /usr/pkg/lib/python2.2/site-packages/ZEO/tests/speed.pys   readable? s    c    s*   |  i d ƒ } |  i ƒ  t i d ƒ d  S(   Ni   i    (   s   selfs   recvs   bufs	   delete_fss   oss   _exit(   s   selfs   buf(    (    s7   /usr/pkg/lib/python2.2/site-packages/ZEO/tests/speed.pys   handle_readA s     
c    s    d GH|  i ƒ  t i d ƒ d  S(   Ns"   Parent process exited unexpectedlyi    (   s   selfs	   delete_fss   oss   _exit(   s   self(    (    s7   /usr/pkg/lib/python2.2/site-packages/ZEO/tests/speed.pys   handle_closeF s    
c    s3   t  i t ƒ t  i t d ƒ t  i t d ƒ d  S(   Ns   .locks   .tmp(   s   oss   unlinks   fs_name(   s   self(    (    s7   /usr/pkg/lib/python2.2/site-packages/ZEO/tests/speed.pys	   delete_fsJ s    (   s   __name__s
   __module__s   __doc__s   writables   readables   handle_reads   handle_closes	   delete_fs(    (    (    s7   /usr/pkg/lib/python2.2/site-packages/ZEO/tests/speed.pys   ZEOExit; s    				c    s  xt  | ƒ D]ö} xíd d d d f D]Ù} t i ƒ  } d }	 |  i ƒ  } xd où yÔ t
 ƒ  i ƒ  | i ƒ  }
 d | } |
 i | ƒ o |
 | } n t ƒ  |
 | <} xn t  | ƒ D]` } t | t | ƒ t ƒ  ƒ } | t j	 o | | ƒ | _ n
 | | _ t | t | ƒ | ƒ q¶ Wt
 ƒ  i ƒ  Wn t j
 o |	 d }	 n XPqM W| i ƒ  t i ƒ  | } | oB | t j o d | | | |	 f GHn d | | | |	 | f GHn | | i! | |	 f ƒ t }
 } } } | o t i# d	 ƒ | i$ d	 ƒ n q& Wq Wd  S(
   Ni   i
   id   iè  i    s   s%ss   %s	%s	%.4f	%ds   %s	%s	%.4f	%d	%di   (%   s   ranges   nreps   js   rs   times   ts	   conflictss   dbs   opens   jars   get_transactions   begins   roots   rts   keys   has_keys   ps   Ps   is   getattrs   strs   vs   compresss   Nones   datas   ds   setattrs   commits   ConflictErrors   closes   detaileds   threadnos   resultss   appends   minimizes   sleeps   cacheMinimize(   s   dbs   resultss   nreps   compresss   datas   detaileds   minimizes   threadnos   keys	   conflictss   rts   ds   ps   is   js   jars   rs   ts   v(    (    s7   /usr/pkg/lib/python2.2/site-packages/ZEO/tests/speed.pys   workO sL       
 	
c    sË  t  i  |  d ƒ \ } }  t } t } t i d } d } d } d } t } d } d } x,| D]$\ } } | d j o t | ƒ } nü | d j o
 | } nå | d j o
 | } nÎ | d	 j o d  k } | i } n« | d
 j o
 d } n” | d j o
 d } n} | d j o$ d t i d <d t i d <d a nL | d j o
 d } n5 | d j o
 d } n | d j o t | ƒ } n q\ Wt } | o1 t | t ƒ  t ƒ  d f ƒ } | i } t } n( t i d t d f d | ƒ\ } } } t | ƒ i  ƒ  } t! i" | d d d d ƒ} d GHh  g  d <g  d <g  d <g  d  <} | d j o d  k% }
 g  } xQ t' | ƒ D]C } |
 i) d! t* d" | | | | | | | | f ƒ } | i, | ƒ qnWx | D] } | i- ƒ  q¼Wx | D] } | i. ƒ  q×Wn t* | | | | | | | ƒ | t j	 o | i/ ƒ  t i0 | d ƒ n | o d# d$ GHn d% GHxu d d d d  f D]a }	 g  } x% | |	 D] \ } } | i, | ƒ qyWt5 | ƒ } d& |	 | t6 | ƒ t7 | ƒ f GHqbWd  S('   Ns   zd:n:Ds:LMt:Ui    i   i   s   AF_INETs   -ns   -ds   -ss   -zs   -Ls   -Ms   -Ds    s   STUPID_LOG_FILEs   -999s   STUPID_LOG_SEVERITYs   -Cs   speeds   -Us   AF_UNIXs   -ts   __doc__s   FileStorages   domains
   cache_sizei   s   cache_deactivate_afterip  s   Beginning work...i
   id   iè  s   targets   argss   -i   s   num	mean	min	maxs   %d	%.4f	%.4f	%.4f(8   s   getopts   argss   optss   Nones   ss   compresss   syss   argvs   datas   nreps   minimizes   detaileds   caches   domains   threadss   os   vs   ints   zlibs   oss   environs   debugs   zeo_pipes
   __import__s   globalss   Storages   servers   forkers	   start_zeos   fs_names   pids   opens   reads   ZODBs   DBs   dbs   resultss	   threadings   ls   ranges   is   Threads   works   ts   appends   starts   joins   closes   waitpids   rs   timess   times   confs   means   mins   max(   s   argss   detaileds   domains   pids   resultss   confs   servers   caches   ss   rs	   threadings   dbs   compresss   nreps   threadss   datas   is   zlibs   vs   ls   os   timess   minimizes   ts   times   zeo_pipes   opts(    (    s7   /usr/pkg/lib/python2.2/site-packages/ZEO/tests/speed.pys   mainz sœ       
 
	

 


	
		*	 $  
  c    s3   d } x |  D] } | | } q W| t |  ƒ Sd  S(   Ni    (   s   tots   ls   vs   len(   s   ls   tots   v(    (    s7   /usr/pkg/lib/python2.2/site-packages/ZEO/tests/speed.pys   meanË s
     s   __main__i   (   s   usages   asyncores   syss   oss   getopts   strings   times   ZODBs   ZODB.FileStorages   Persistences   ZEO.ClientStorages   ZEOs   ZEO.StorageServers	   ZEO.testss   forkers   ZODB.POSExceptions   ConflictErrors
   Persistents   Ps   fs_names   file_dispatchers   ZEOExits   Nones   works   mains   means   __name__s   argv(   s   fs_names   asyncores   strings   Ps   ZEOExits   works   ZEOs   forkers   syss   ConflictErrors   ZODBs   times   usages   getopts   mains   oss   Persistences   mean(    (    s7   /usr/pkg/lib/python2.2/site-packages/ZEO/tests/speed.pys   ? s   	-	+	Q	