Created
January 1, 2011 06:34
-
-
Save lusis/761594 to your computer and use it in GitHub Desktop.
Proof of concept voldemort jmx stats via jruby
This file contains 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 'rubygems' | |
begin | |
require 'jmx' | |
rescue LoadError | |
puts "This must be run under JRuby. Sorry" | |
exit(1) | |
end | |
client = JMX.connect :host => 'localhost', :port => '9998' | |
#puts client.domains.to_a | |
socket_server = client['voldemort.server.socket:type=socket-server'] | |
store_stats_agg = client['voldemort.store.stats.aggregate:type=aggregate-perf'] | |
puts "Current threads: #{socket_server.current_threads}" | |
puts "Average Get Time: #{store_stats_agg.average_get_completion_time_in_ms}ms" | |
%w[get put delete get_all].each do |op| | |
stat = "store_stats_agg.number_of_calls_to_#{op}" | |
puts "#{op} Calls: #{eval(stat)}" | |
end | |
puts "Obsolete Versions: #{store_stats_agg.number_of_obsolete_versions}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment