On the .NET platform all runtime statistics are published through the Windows Performance Counters. This means that you can use the regular windows tooling to monitor db4o statistics.
The first thing we need to do is to add the monitoring support to the db4o configuration. The monitoring-support are in the optional-assemblys. So you need to add those for the monitoring support.
Monitoring adds a small overhead to the regular db4o operations. Therefore the monitoring support is distributed across different monitoring options, so that you can add only the options you need.
Currently following options are available:
In order to monitor db4o you need to install the db4o performance counters. This needs to be done only once on the machine you want to monitor. Installing the performance counters require Administrator privileges.
You can install the performance counter either from you application with an simple method call or with the db4oTool.
You can install it by simply calling the install-method on the Db4oPerformanceCounters class. Not that your application needs to run with Administrator privileges to successfully install the performance counters.
Db4oPerformanceCounters.Install();
Db4oPerformanceCounters.Install()
You can install it with the db4oTool. Note that the Db4oTool needs to be executed with Administrator privileges to successfully install the performance counters.
Db4oTool.exe -install-performance-counters
To monitor the db4o performance counters, you can use the Windows Performance Monitor (perfom.exe). You can start the Performance Monitor by opening the Run-dialog (Windows-Key + R) and enter 'perfmon' and execute.
First select which performance counters you want to monitor and for which db4o instance. Click the 'Add'-Botton on the toolbar. There scroll to the db4o-category and select the performance-counter and the instance you want to monitor.
After that, you can watch the performance-counters. Read the Performance Monitor reference for more information.