,I'Berkeley DB: DbLog::stat[P

DbLog::stat





#include <db_cxx.h>

int;DbLog::stat(DB_LOG_STAT **spp, void *(*db_malloc)(size_t));





Description



CThe DbLog::stat function creates a statistical structure and copies8a pointer to it into the user-specified memory location.

6Statistical structure are created in allocated memory.IfBdb_malloc is non-NULL, it is called to allocate the memory,:otherwise, the library function malloc(3)) is used.CThe function db_malloc must match the calling conventions of&the malloc(3)) library routine.CRegardless, the caller is responsible for deallocating the returnedmemory.ETo deallocate the returned memory, free each returned memory pointer;@pointers inside the memory do not need to be individually freed.

HThe log region statistics are stored in a structure of type DB_LOG_STAT.3The following DB_LOG_STAT fields will be filled in:

Q
u_int32_t st_magic;
The magic number that identifies a file as a log file.>
u_int32_t st_version;
The version of the log file type.C
u_int32_t st_refcnt;
The number of references to the region.4
u_int32_t st_regsize;
The size of the region.6
int st_mode;
The mode of any created log files.W
u_int32_t st_lg_max;
The maximum size of any individual file comprising the log.J
u_int32_t st_w_mbytes;
The number of megabytes written to this log.g
u_int32_t st_w_bytes;
The number of bytes over and above st_w_mbytes written to this log.e
u_int32_t st_wc_mbytes;
The number of megabytes written to this log since the last checkpoint.h
u_int32_t st_wc_bytes;
The number of bytes over and above st_wc_mbytes written to this logsince the last checkpoint.Q
u_int32_t st_wcount;
The number of times the log has been written to disk.Q
u_int32_t st_scount;
The number of times the log has been flushed to disk.:
u_int32_t st_cur_file;
The current log file number.H
u_int32_t st_cur_offset;
The byte offset in the current log file.g
u_int32_t st_region_wait;
The number of times that a thread of control was forced to wait beforeobtaining the region lock.b
u_int32_t st_region_nowait;
The number of times that a thread of control was able to obtain the region lock without waiting.


The DbLog::stat>method either returns errno or throws an exception that:encapsulates an errno on failure, and 0 on success.



Errors

RIf a fatal error occurs in Berkeley DB, the DbLog::stat method may fail and eitherIreturn DB_RUNRECOVERY or throw an exception encapsulating DB_RUNRECOVERY,Gat which point all subsequent database calls will also fail in the sameFway. Methods marked as returning errno will, by default, throwHan exception that encapsulates the error information. The default error\behavior can be changed, see DbException.

The DbLog::stat&method may fail and throw an exceptionKfor any of the errors specified for the following Berkeley DB and C library functions: abort(3), fcntl(3), fprintf(3), getpid(3), malloc(3),and memset(3).



Class

2DbLog



See Also

>DbLog::archive,:DbLog::close,>DbLog::compare,8DbLog::file,:DbLog::flush,6DbLog::get,8DbLog::open,6DbLog::put,FDbLog::db_register, DbLog::stat,;DbLog::unlinkandJDbLog::db_unregister.
ÿÿ