-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tres Seaver wrote:
> Chris Withers wrote:
> 
>> Anyone found any good logging methods or other strategies for 
>> determining which request dragged all the object in the zodb into memory?
> 
> I haven't used it this way, but the ActivityMonitor attached to the
> database keeps track of statistics which could be useful:
> 'db.getActivityMonitor().log' is the time-series (per request) which is
> used to generate the data for the "Activity" tab on the Control_Panel,
> via its 'getActivityAnalysis' method.
> 
> However, that data doesn't record anything about the request except the
> "end time".  You could also use the connection's 'getTransferCounts'
> method, which returns the number of loads and stores done on the jar.
> 
> You might be able to get away with hacking in some extra records into
> the trace log with this data, e.g.:
> 
>   loads_before, stores_before = connection.getTransferCounts()
>   # do the reqeust
>   loads_after, stores_after = connection.getTransferCounts()
>   from ZServer.DebugLogger import log
>   log('L', id(request), loads_after - loads_before)
>   log('S', id(request), loads_after - stores_before)
> 
> You might need to monkeypatch Zope2.bobo_before and Zope2.bobo_after to
> get this hooked in right.

It was a little tricker than that, but I have a working version available:

  http://agendaless.com/Members/tseaver/software/thrashcatcher/


Tres.
- --
===================================================================
Tres Seaver          +1 540-429-0999          [EMAIL PROTECTED]
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHDlkt+gerLs4ltQ4RAkJ9AKCog282alWyJMNBUjU122Xt1raoHwCg2UKk
o9TZFNzo754Tbsjvw4NAe1M=
=RaVw
-----END PGP SIGNATURE-----
_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to