Isn't this something that would be well suited for DTrace? I am assuming you are running Solaris 10...
Sorry I was in a meeting the first go around Brendan Gregg would do something like this
* mysqld_pid_etime.d - measure mysqld query execution latency.
* Written for Solaris 10 (needs DTrace).
* 01-Jun-2007, ver 0.50
* USAGE: ./mysqld_pid_etime.d -p `pgrep -x mysqld`
* This prints distribution plots of the elapsed time during the execu
* of MySQL statements, with a plot for each query string traced. This
* measure the execution stage only, not the parse or plan stages.
* This is written using the DTrace pid provider, which means it uses
* unstable interface and is likely to stop working for future version
* mysql (this was tested on mysql-5.1.17-beta).
* 01-Jun-2007 Brendan Gregg Created this.
#pragma D option quiet
printf("Tracing... Hit Ctrl-C to end.\n");
self->query = copyinstr(arg1);
self->start = timestamp;
this->elapsed = timestamp - self->start;
@time[self->query] = quantize(this->elapsed);
self->query = 0;
self->start = 0;
printf("MySQL Query execution latency (ns):\n");
There is a lot more detail to be found HERE
Hope this points you in the right direction. Cheers - Jeffery
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||