Last active
August 29, 2015 14:06
-
-
Save bkerley/73e21ed7af26e609c6e7 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
require 'riak' | |
require 'instrumentable' | |
require 'pp' | |
c = Riak::Client.new pb_port: 17017 | |
class Riak::Client | |
include Instrumentable | |
instrument_method :get_object, 'get_object' | |
instrument_method :store_object, 'store_object' | |
end | |
ActiveSupport::Notifications.subscribe('get_object') do |*args| | |
pp args | |
end | |
ActiveSupport::Notifications.subscribe('store_object') do |*args| | |
pp args | |
end | |
b = c['instrumentation_spike'] | |
100.times do |t| | |
o = Riak::RObject.new b, t.to_s | |
o.data = t.to_s | |
o.content_type = 'text/plain' | |
o.store | |
o2 = b.get t.to_s | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment