[collectd] SQLite file statistics plugin?

Amos Shapira amos.shapira at gmail.com
Tue Mar 1 10:20:21 CET 2011


Hello,

I was wondering whether there already exists a collectd plugin which
can collect statistics about sqlite files.

I mean - not collect the statistics INTO an sqlite file but read the
sqlite file header as described in
http://www.sqlite.org/fileformat2.html and watch the values there.

Interesting stats I can see right now:

offset 24, 4 bytes: File change counter.
offset 28, 4 bytes: Size of the database file in pages. The "in-header
database size".
offset 36, 4 bytes: Total number of freelist pages.

I imagine it could be easy to write a program which just mmap(2)'s the
header read-only and reports these offsets.

Does something like this already exist?

Thanks,

--Amos



More information about the collectd mailing list