# The eXtremeDB Performance Monitor

> The eXtremeDB Performance Monitor allows to collect various runtime metrics. The collected metrics can be accessed via the REST API.

> The Performance Monitor consists of:

> - an in-memory database
> - a monitor thread that collects and stores metrics in the database

> Any eXtremeDB database can be attached to the monitor which takes "readings" at regular intervals and stores counter values in an in-memory database called "perfmon". These values are then rolled up into metrics that can be viewed using the xPanel application.

> ## Performance Monitor APIs

> The performance monitor APIs consist of a small set of functions or class methods that implement the following four operations: initialize, get / set options, attach and detach the database. Please use the links below to view detailed explanations for your development environment:

> C
> Performance monitor C API
> xSQL
> Performance monitor with xSQL
> Python
> Performance monitor Python API

> ## Performance Metrics

> The monitor reads and stores scalar value statistics such as: `error count, connection count, connects, host CPU load, host memory usage, opened transactions, opened cursors, last snapshot size, max connections, database total pages, database free pages, database used pages, database file size, database log file size, database used file size, cache hit count, cache miss count, cache pages allocated, cache pages used, cache pages pinned, cache pages modified, cache pages dirty, cache pages copied, cache pages write delayed.`

> Then, over the entire monitoring period, the monitor calculates and updates aggregated counters so that each of the operations listed is reflected in the values. Most of these values are calculated using simple statistics functions such as: `current` (the latest value), `min, max, avg, count, total count.` The aggregated counters are for operations such as: `Disk read, Disk write, Log write, Commit time, Rollback time, Snapshot duration.`