Created
November 20, 2019 15:44
-
-
Save dalehamel/e98936a8655be5125a01668cf4e74347 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
BEGIN | |
{ | |
printf("%-20s %10s %10s %10s\n", "MEMCACHED KEY", "CALLS", "OBJSIZE", "REQ/s"); | |
@start = nsecs; | |
} | |
// NOTE - this presently omits incr, decr, and delete because they have a | |
// different signature | |
usdt::memcached:command__get, | |
usdt::memcached:command__set, | |
usdt::memcached:command__add, | |
usdt::memcached:command__append, | |
usdt::memcached:command__prepend, | |
usdt::memcached:command__touch, | |
usdt::memcached:command__cas, | |
usdt::memcached:command__replace | |
{ | |
@calls[str(arg1, arg2)]++; | |
$objsize = arg3; | |
$interval = (nsecs - @start) / 1000000000; | |
$cps = @calls[str(arg1)] / $interval; | |
printf("%-20s %10d %10d %10d\n", str(arg1, arg2), @calls[str(arg1, arg2)], | |
$objsize, $cps) | |
} | |
END | |
{ | |
clear(@start); | |
clear(@calls); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment