Last active
August 29, 2015 14:15
-
-
Save stevenwilliamson/0acddf5a8592b406c44b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/sbin/dtrace -s | |
#pragma D option quiet | |
#pragma D option strsize=8096 | |
/*Output mysql queries in slow query log format*/ | |
pid$target::*mysql_parse*:entry / strstr(copyinstr(arg1), "ledger_entries") != NULL / /* This probe is fired when the execution enters mysql_parse */ | |
{ | |
self->s_time = timestamp; | |
} | |
pid$target::*mysql_parse*:return / self->s_time / /* This probe is fired when the execution enters mysql_parse */ | |
{ | |
/*@querytime = quantize((timestamp - self->s_time) / 1000000);*/ | |
@querytime = llquantize((timestamp - self->s_time) / 1000, 10, 0 , 6, 10); | |
self->s_time = 0; | |
} | |
tick-30s { | |
printa(@querytime); | |
clear(@querytime); | |
} | |
Exits with dtrace: processing aborted: No such file or directory, after printing first aggregation when using llquantize |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment