Re: [ZODB-Dev] How do I find out the size of a subtree of the object graph?

2009-09-14 Thread Jim Fulton
On Mon, Sep 14, 2009 at 10:43 AM, David Glick  wrote:
> On Sep 14, 2009, at 7:04 AM, Jim Fulton wrote:
>>
>> On Mon, Sep 14, 2009 at 7:10 AM, Chris Withers 
>> wrote:
>>>
>>> Jim Fulton wrote:

 ZODB doesn't provide any direct support because it has no notion of
 tree.
>>>
>>> Does it have any notion of object size on disk for a given object?
>>
>> Not directly, but you can do:
>>
>>  len(ob._p_jar.db().storage.load(ob._p_oid, '')[0])+42
>
>
> What's the extra 42 for?  Aside from life, the universe, and everything...

Database record header. There's also space for transaction meta data,
but that's amorized over an unknown number of records.

Jim

-- 
Jim Fulton
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zodb-dev


Re: [ZODB-Dev] How do I find out the size of a subtree of the object graph?

2009-09-14 Thread David Glick
On Sep 14, 2009, at 7:04 AM, Jim Fulton wrote:
> On Mon, Sep 14, 2009 at 7:10 AM, Chris Withers  
>  wrote:
>> Jim Fulton wrote:
>>>
>>> ZODB doesn't provide any direct support because it has no notion  
>>> of tree.
>>
>> Does it have any notion of object size on disk for a given object?
>
> Not directly, but you can do:
>
>  len(ob._p_jar.db().storage.load(ob._p_oid, '')[0])+42


What's the extra 42 for?  Aside from life, the universe, and  
everything...


David Glick
Web Developer
ONE/Northwest

New tools and strategies for engaging people in protecting the  
environment

http://www.onenw.org
davidgl...@onenw.org
work: (206) 286-1235 x32
mobile: (206) 679-3833

Subscribe to ONEList, our email newsletter!
Practical advice for effective online engagement
http://www.onenw.org/full_signup




___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zodb-dev


Re: [ZODB-Dev] How do I find out the size of a subtree of the object graph?

2009-09-14 Thread Jim Fulton
On Mon, Sep 14, 2009 at 7:10 AM, Chris Withers  wrote:
> Jim Fulton wrote:
>>
>> ZODB doesn't provide any direct support because it has no notion of tree.
>
> Does it have any notion of object size on disk for a given object?

Not directly, but you can do:

  len(ob._p_jar.db().storage.load(ob._p_oid, '')[0])+42

Jim

-- 
Jim Fulton
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zodb-dev


Re: [ZODB-Dev] How do I find out the size of a subtree of the object graph?

2009-09-14 Thread Jens Vagelpohl


On Sep 14, 2009, at 13:27 , Chris Withers wrote:


Jens Vagelpohl wrote:
Sadly, when you're trying to figure out which folder is using all  
the

space on a disk that's running out of space, that's not practical...
How about simply writing a script that crawls the ZODB and gives  
you paths and sizes?


Indeed, and what's the magic incantation to get the size of the  
object as it is on disk?


There is none that I know. I would simply look at the data items I  
know from the object in the ZODB. Like, I know how OFS.Image and  
OFS.File save their data and can determine the size that way. You  
would have to have knowledge about each type of object encountered.


jens




smime.p7s
Description: S/MIME cryptographic signature
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zodb-dev


Re: [ZODB-Dev] How do I find out the size of a subtree of the object graph?

2009-09-14 Thread Andreas Jung
On 14.09.09 13:27, Chris Withers wrote:
> Jens Vagelpohl wrote:
>   
>> 
>>> Sadly, when you're trying to figure out which folder is using all the
>>> space on a disk that's running out of space, that's not practical...
>>>   
>> How about simply writing a script that crawls the ZODB and gives you 
>> paths and sizes?
>> 
> Indeed, and what's the magic incantation to get the size of the object 
> as it is on disk?

Perhaps useful:

https://bugs.launchpad.net/zodb/+bug/424172

(but pretty low-level).

Andreas
<>___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zodb-dev


Re: [ZODB-Dev] How do I find out the size of a subtree of the object graph?

2009-09-14 Thread Chris Withers
Jens Vagelpohl wrote:
> 
>> Sadly, when you're trying to figure out which folder is using all the
>> space on a disk that's running out of space, that's not practical...
> 
> How about simply writing a script that crawls the ZODB and gives you 
> paths and sizes?

Indeed, and what's the magic incantation to get the size of the object 
as it is on disk?

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zodb-dev


Re: [ZODB-Dev] How do I find out the size of a subtree of the object graph?

2009-09-14 Thread Jens Vagelpohl


On Sep 14, 2009, at 13:10 , Chris Withers wrote:


Jim Fulton wrote:
ZODB doesn't provide any direct support because it has no notion of  
tree.


Does it have any notion of object size on disk for a given object?

In Zope 2, you could export the folder and look at the size of the  
export.


Sadly, when you're trying to figure out which folder is using all the
space on a disk that's running out of space, that's not practical...


How about simply writing a script that crawls the ZODB and gives you  
paths and sizes?


jens




smime.p7s
Description: S/MIME cryptographic signature
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zodb-dev


Re: [ZODB-Dev] How do I find out the size of a subtree of the object graph?

2009-09-14 Thread Chris Withers
Jim Fulton wrote:
> ZODB doesn't provide any direct support because it has no notion of tree.

Does it have any notion of object size on disk for a given object?

> In Zope 2, you could export the folder and look at the size of the export.

Sadly, when you're trying to figure out which folder is using all the 
space on a disk that's running out of space, that's not practical...

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zodb-dev


Re: [ZODB-Dev] How do I find out the size of a subtree of the object graph?

2009-09-14 Thread Jim Fulton
On Mon, Sep 14, 2009 at 5:55 AM, Chris Withers  wrote:
> Hi All,
>
> As the subject line says with the following definitions:
>
> - size = size on disk, in Mb
>
> - subtee = Zope folderish type things, in this case...

ZODB doesn't provide any direct support because it has no notion of tree.

In Zope 2, you could export the folder and look at the size of the export.

Jim

-- 
Jim Fulton
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zodb-dev


[ZODB-Dev] How do I find out the size of a subtree of the object graph?

2009-09-14 Thread Chris Withers
Hi All,

As the subject line says with the following definitions:

- size = size on disk, in Mb

- subtee = Zope folderish type things, in this case...

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zodb-dev