Connection Probes


The connection-start and connection-done probes enclose a connection from a client, regardless of whether the connection is through a socket or network connection.

connection-start(connectionid, user, host)
connection-done(status, connectionid)

The following D script will quantify and summarize the average duration of individual connections, and provide a count, dumping the information every 60 seconds:

#!/usr/sbin/dtrace -s mysql*:::connection-start
{
 self->start = timestamp;
}
mysql*:::connection-done
/self->start/
{
 @ = quantize(((timestamp - self->start)/1000000));
 self->start = 0;
}
tick-60s
{
 printa(@);
}

When executed on a server with a large number of clients you might see output similar to this:

Retornar