1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Added DTrace example scripts

This commit is contained in:
Mikael Ronstrom
2009-03-06 13:31:03 +01:00
parent cd9f785da4
commit faff5c40d4
9 changed files with 400 additions and 0 deletions

View File

@ -0,0 +1,23 @@
#!/usr/sbin/dtrace -s
#
# Shows time take to actually parse the query statement
#pragma D option quiet
mysql*:::query-parse-start
{
self->parsestart = timestamp;
self->parsequery = copyinstr(arg0);
}
mysql*:::query-parse-done
/arg0 == 0/
{
printf("Parsing %s: %d microseconds\n", self->parsequery,((timestamp - self->parsestart)/1000));
}
mysql*:::query-parse-done
/arg0 != 0/
{
printf("Error parsing %s: %d microseconds\n", self->parsequery,((timestamp - self->parsestart)/1000));
}