status



Retrieves runtime status information about the performance of the database engine, and optionally resets various highwater marks.

Arguments: The arguments are:
optParam [required] One of the runtime Status Parameter Constants parameter constants. This specifies which status parameter information is required.
result [required IN/OUT] ADirectoryobject in which the retrieved information is returned. On a successful return the directory object will contain the following two indexes:
CURRENT: The current value of the parameter specified byoptParam.
HIGHWATER: The highest recorded value of the parameter specified byoptParam.
reset [optional] A logical value, true or false, to specifiy whether the high water mark should be reset. The default if omitted is false.
Return value: Returns one of the ooSQLite Result Code Constants code constants. OK on success, otherwise an error code. On error no indexes of theresultobject are set.
Remarks: Some parameters do not record the highest value. Other parameters record only the highwater mark and not the current value. For parameters that do not record the highest value, thereset argument is ignored.
Details The functionality of thestatusmethod is similar to that of the SQLite sqlite3_status API.
Example: This example prints out all the status parameters:
a = .array~of( -
.ooSQLite~STATUS_MEMORY_USED ,-
.ooSQLite~STATUS_PAGECACHE_USED ,-
.ooSQLite~STATUS_PAGECACHE_OVERFLOW ,-
.ooSQLite~STATUS_SCRATCH_USED ,-
.ooSQLite~STATUS_SCRATCH_OVERFLOW ,-
.ooSQLite~STATUS_MALLOC_SIZE ,-
.ooSQLite~STATUS_PARSER_STACK ,-
.ooSQLite~STATUS_PAGECACHE_SIZE ,-
.ooSQLite~STATUS_SCRATCH_SIZE ,-
.ooSQLite~STATUS_MALLOC_COUNT -
)
n = .array~of( -
'STATUS_MEMORY_USED ' ,-
'STATUS_PAGECACHE_USED ' ,-
'STATUS_PAGECACHE_OVERFLOW' ,-
'STATUS_SCRATCH_USED ' ,-
'STATUS_SCRATCH_OVERFLOW ' ,-
'STATUS_MALLOC_SIZE ' ,-
'STATUS_PARSER_STACK ' ,-
'STATUS_PAGECACHE_SIZE ' ,-
'STATUS_SCRATCH_SIZE ' ,-
'STATUS_MALLOC_COUNT ' -
)
values = .directory~new
do i = 1 to a~items
.ooSQLite~status(a[i], values)
say n[i]': current:' values~current~left(10) 'high water:' values~highWater
end
/* Output might be:
STATUS_MEMORY_USED : current: 88864 high water: 93664
STATUS_PAGECACHE_USED : current: 0 high water: 0
STATUS_PAGECACHE_OVERFLOW: current: 16288 high water: 16288
STATUS_SCRATCH_USED : current: 0 high water: 0
STATUS_SCRATCH_OVERFLOW : current: 0 high water: 0
STATUS_MALLOC_SIZE : current: 512 high water: 64000
STATUS_PARSER_STACK : current: 0 high water: 0
STATUS_PAGECACHE_SIZE : current: 1272 high water: 1272
STATUS_SCRATCH_SIZE : current: 0 high water: 0
STATUS_MALLOC_COUNT : current: 95 high water: 105
*/