Back Midas Rome Roody Rootana
  Midas DAQ System  Not logged in ELOG logo
Entry  19 Mar 2018, Andreas Suter, Suggestion, check current ODB size 
    Reply  19 Mar 2018, Stefan Ritt, Suggestion, check current ODB size 
       Reply  19 Mar 2018, Andreas Suter, Suggestion, check current ODB size 
          Reply  19 Mar 2018, Stefan Ritt, Suggestion, check current ODB size 
Message ID: 1359     Entry time: 19 Mar 2018     In reply to: 1358
Author: Stefan Ritt 
Topic: Suggestion 
Subject: check current ODB size 
> > > A feature I always missed (or just missed to find in the docu) is the following:
> > > 1) It would be nice to have a command in odbedit which allows to check how full
> > > the ODB currently is.
> > > 2) Even more important: I would like to have an ODB routine which allows me to
> > > check the fill level of the ODB, and/or a routine which tells me if I would
> > > create a structure of given size that it still fits in the current ODB or not. 
> > > The use case is that some clients create on the fly ODB entries and I would like
> > > to make sure before hand the ODB's remaining space in order not to crash things
> > > by overfilling the ODB. 
> > 
> > If you do "mem" in odbedit, you see the currently free areas, one for the keys themselves, one for 
> > the data of the keys. The corresponding C function is db_show_mem. At the moment it outputs the 
> > list of free blocks as a long ASCII string, but if necessary I can write a variant which returns the 
> > number of free bytes.
> > 
> > Stefan
> 
> Thanks for the info, and yes a variant of db_show_mem returning the number of free bytes would be just
> prefect!

I made you db_get_free_mem(HNDLE hDB, INT *key_size, INT *data_size)

The first return gets you the number of free bytes for the key area, the second one for the data area (values of keys).

Committed to develop

Stefan
ELOG V3.1.4-2e1708b5