Example 1 — Dump a Few Client Counters
Read mysqlnd client stats and print selected keys from a fixed sample array.
<?php
$stats = mysqli_get_client_stats();
echo "bytes_sent=", $stats["bytes_sent"], PHP_EOL;
echo "bytes_received=", $stats["bytes_received"], PHP_EOL; How It Works
- mysqli_get_client_stats() returns the mysqlnd array.
- Two common keys are printed.
- A fresh process may still show zeros in the sample.
- After real queries the counters increase.

