문제

If I have a PHP script that makes a MySQL call/query. Is there a way to log/audit the size of the response/data (in bytes) that is returned from that call?

I know I could use tcpdump, but that does not necessarily ensure the traffic stats I gather are for a certain transaction (IE: I may have 5 transactions at roughly the same time, making it impossible to determine one transaction from another).

도움이 되었습니까?

해결책

mysqli has a couple of functions that will give you some stats:

Some of the statistics available include:

  • bytes_sent - Number of bytes sent from PHP to the MySQL server
  • bytes_received - Number of bytes received from MySQL server

Take a look at this page to see the all the stats you can get if you're using the MySQL Native Driver: MySQL Native Driver statistics

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top