Skip to content

Instantly share code, notes, and snippets.

@dalehamel
Created March 10, 2020 01:47
Show Gist options
  • Save dalehamel/28c51b545fed3d0b1f4451c1e57363ca to your computer and use it in GitHub Desktop.
Save dalehamel/28c51b545fed3d0b1f4451c1e57363ca to your computer and use it in GitHub Desktop.
bpftrace script to attach to memcached and probe connections and commands
usdt::memcached:command__get,
usdt::memcached:command__set,
usdt::memcached:command__add,
usdt::memcached:command__replace,
usdt::memcached:command__prepend,
usdt::memcached:command__append,
usdt::memcached:command__cas
{
@calls[str(arg1, arg2)]++;
@bytes[str(arg1, arg2)]+= arg3;
}
usdt::memcached:command__incr,
usdt::memcached:command__decr,
usdt::memcached:command__delete
{
@calls[str(arg1, arg2)]++;
}
usdt::memcached:conn__allocate
{
@conns_allocated++;
}
usdt::memcached:conn__release
{
@conns_released++;
}
usdt::memcached:conn__create
{
@conns_created++;
}
usdt::memcached:conn__destroy
{
@conns_destroyed++;
}
usdt::memcached:conn__dispatch
{
@conns_dispatched++;
}
@dalehamel
Copy link
Author

baseline

Selection_079

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment