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 'abstract_unit' | |
require 'benchmark' | |
class MemcacheClientTest < Test::Unit::TestCase | |
def setup | |
@cache_store = ActiveSupport::Cache.lookup_store(:mem_cache_store, "127.0.0.1:11211", "localhost:11211") | |
@cache_store_no_timeouts = ActiveSupport::Cache.lookup_store(:mem_cache_store,"127.0.0.1:11211", "localhost:11211",{ :timeout => nil }) | |
@test_string = "A short string, but not too short; an average-length string, let's say. Just a little more length. Ok, now we're about right." | |
@test_string_2 = "73f382c327d2fb5809f383fca29b1fa8a9931b3d316836ad8598cdb1f7105a4d98296238a451122b340259ffb0b9b5e517d8d315244fe917e3a114c5d5a367f3" |
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
# cache read benchmark (about a 2k string) | |
# I get the actual memcache store from ActionController | |
cache = ActionController::Caching.send(:class_variable_get,:@@cache_store) | |
# and run the benchmark 100 times | |
ActionController::Base.benchmark "cache benchmark: " do | |
100.times do | |
cache.read('views/sightings/1624/row') | |
end |
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
# autotest your engine plugins together with your rails app | |
# put this .autotest file in your rails root | |
# see http://code.whatcould.com/2009/02/09/gentlemen-test-your-engines.html for details | |
# iirc, I submitted a pull request to zentest but never heard back. | |
# so you'll have to use my zentest fork -- I've been trying to keep it up. | |
# https://github.com/whatcould/zentest -- just build the gem (rake package) and install from that file | |
# rewrite the Autotest::Rails #path_to_classname to include the entire test path |
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
#!/usr/bin/env ruby | |
def output_config | |
puts <<-END | |
graph_category System | |
graph_title accelerator memory | |
graph_vlabel M | |
rss.label rss | |
swap.label swap |
NewerOlder