maria-developers team mailing list archive
Mailing list archive
Re: Audit plugin and qc_info plugin - MDEV-4682
On Aug 15, Roberto Spadim wrote:
> Hi guys, i put some fields in qc_info plugin
> the second part was add some others informations (stats):
> i was reading the "response_time_distribution" of percona, patch at
> could i use the audit plugin to implement MDEV-4682?
> what i need is:
> 1)know if the query was executed with/without query cache
There's no API for that. Perhaps, a plugin can get this information by
declaring MYSQL_SERVER, and looking at THD fields that are normally used
when a query is executed. Like, if they're NULL, the query was in the
query cache. Some hacks like that are, probably, possible.
> 2)know the time expend (lock time, and total time) to execute the
> query (first execution)
no lock time. query time can be calculated by measuring the time between
MYSQL_AUDIT_GENERAL_LOG and MYSQL_AUDIT_GENERAL_STATUS.
> 3)know the time expend with query cache hit
> 4) both (3) and (2) don't include time of network packages, just server
> side times...
> is it possible?
> any idea how could i implement it? i didn't write a audit plugin yet =(
> well.. time to learn =D
Audit API is very simple, you won't have any problems with it :)