Shopify/identity_cache — pull request #93 by hornairs (2013-10-15 19:49:30+00:00)
Title: Make #fetch and #fetch_multi emit ActiveSupport::Notifications for instrumentation of any sort.

This makes IDC emit [`ActiveSupport::Notifications`](http://api.rubyonrails.org/classes/ActiveSupport/Notifications.html) for fetches so we can start tracking hits and misses in statsd and other stuff eventually.

On ze branch:
```
oration ~/C/identity_cache (instrumentation_hooks) ➜ bx rake benchmark:cpu
/opt/boxen/rbenv/versions/1.9.3-p448/bin/ruby ./performance/cpu.rb
Database not ready for performance testing, generating records
Rehearsal ----------------------------------------------------------
FindRunner: 1.260000 0.100000 1.360000 ( 1.759094)
FetchMissRunner: 21.820000 1.270000 23.090000 (139.928938)
FetchHitRunner: 35.350000 2.390000 37.740000 (158.807096)
DoubleFetchHitRunner: 34.660000 2.400000 37.060000 (155.994105)
DoubleFetchMissRunner: 30.040000 2.130000 32.170000 (150.531126)
----------------------------------------------- total: 131.420000sec

user system total real
FindRunner: 1.180000 0.110000 1.290000 ( 1.688685)
FetchMissRunner: 21.350000 1.250000 22.600000 (139.036593)
FetchHitRunner: 32.350000 2.260000 34.610000 (152.959066)
DoubleFetchHitRunner: 34.360000 2.400000 36.760000 (155.403047)
DoubleFetchMissRunner: 29.790000 2.120000 31.910000 (149.987077)
```

On ze master:
```
oration ~/C/identity_cache (master) ➜ bx rake benchmark:cpu
/opt/boxen/rbenv/versions/1.9.3-p448/bin/ruby ./performance/cpu.rb
Rehearsal ----------------------------------------------------------
FindRunner: 1.180000 0.110000 1.290000 ( 1.694002)
FetchMissRunner: 22.030000 1.280000 23.310000 (140.561444)
FetchHitRunner: 35.520000 2.410000 37.930000 (159.102155)
DoubleFetchHitRunner: 36.220000 2.490000 38.710000 (158.796237)
DoubleFetchMissRunner: 31.360000 2.180000 33.540000 (152.982849)
----------------------------------------------- total: 134.780000sec

user system total real
FindRunner: 1.240000 0.120000 1.360000 ( 1.791787)
FetchMissRunner: 22.070000 1.300000 23.370000 (140.411133)
FetchHitRunner: 32.430000 2.300000 34.730000 (153.066971)
DoubleFetchHitRunner: 34.540000 2.430000 36.970000 (155.922840)
DoubleFetchMissRunner: 29.870000 2.150000 32.020000 (150.509368)
```

@camilo @fbogsany thoughts?