newrelic/rpm — pull request #174 by fbogsany (2014-06-19 20:31:32+00:00)
Title: Fix Memcached instrumentation

The `Memcached.cas` instrumentation includes time spent in the block rather than just time spent in memcache. In clients like https://github.com/Shopify/identity_cache, this can include database query time, which is separately instrumented.

Memcached 1.8.0 refactored `cas` and `get` to use common `single_get` and `multi_get` primitives to read from memcache, and `cas` to use `single_cas` and `multi_cas` primitives to write to memcache *after* the block is called: https://github.com/evan/memcached/pull/152

This PR instruments the primitives instead of the `cas` and `get` commands to avoid counting time spent in the block.