[ZODB-Dev] RE: [Zope] Analyzing ZODB objects

Paul Winkler pw_lists at slinkp.com
Fri Oct 24 02:20:39 EDT 2003


On Fri, Oct 24, 2003 at 10:52:18AM +0800, Bjorn Stabell wrote:
> > From: Dieter Maurer [mailto:dieter at handshake.de] 
> [...]
> > They can be far apart. Although, when your pickle is several 
> > MB your object is not several bytes and vice versa.
> 
> Well, in that case it might be useful for such a ZODB admin tool to show
> both sizes.  It could be a combined cache analysis and ZODB browsing
> tool.

Except, as people have already said, there is no general way
to find out how much memory an arbitrary object is using.
It would be really nice if we could find that out, but we 
simply can't do it.

> interfaces--ZODB feels much like a "black box" to me.

That's because it is :-)
You don't really want to know about the ZODB level. The objects 
in it are basically just binary dumps of objects and you can't
tell much about them by looking at the binary dump.
You want to know about how your zope objects work. 
Different thing entirely.

> Example use cases include:
(snip)
> - UNDERSTANDING CONTENT TYPES AND TOOLS.  What is the difference in the
> data structure of PloneDocument and CMFDocument?

You can learn a lot of such things by installing DocFinderEverywhere.
Try it.

> - DEBUGGING CLASS MIGRATION PROBLEMS.  Some older objects are exhibiting
> strange behavior; what is the difference in data structure between them
> and the new objects?  Which objects of class X doesn't have attribute A
> set?

You can find this out interactively with a python prompt.
Google for "conversations with zope".

> - VERIFYING AND IMPROVING DATA STORAGE SCHEMAS.  Does class X really
> store the attributes I thought it would?

again, you can easily find this out at the prompt.

> - CHANGING A PROPERTY THAT DOESN'T HAVE A MANAGEMENT INTERFACE.  For
> debugging, testing, or migration purposes, or for just fixing a one-off
> bug.

i think you know what I am going to say next :-)

> The truth is, I think this kind of tool will "open my eyes" to what's in
> the ZODB and take much of the guesswork out of developing with Zope,
> similar to the eye opening experience a RDBMS admin tool is.

funny, that's exactly how I feel about the python prompt.
Try it. It's addictive :-)

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's NUNGO-AUSTIN X!
(random hero from isometric.spaceninja.com)



More information about the Zope mailing list