From ec42f0c4f4dd690044e8016f7c7e6a3c20f83e37 Mon Sep 17 00:00:00 2001 From: Rupa Schomaker Date: Wed, 1 Apr 2009 20:37:13 +0000 Subject: [PATCH] small stress script git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12875 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- .../mod_memcache/mod_memcache_stress.rb | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 src/mod/applications/mod_memcache/mod_memcache_stress.rb diff --git a/src/mod/applications/mod_memcache/mod_memcache_stress.rb b/src/mod/applications/mod_memcache/mod_memcache_stress.rb new file mode 100755 index 0000000000..ac578ca5a3 --- /dev/null +++ b/src/mod/applications/mod_memcache/mod_memcache_stress.rb @@ -0,0 +1,28 @@ +#! /usr/bin/ruby + +#require "ESL" +require "../../../../libs/esl/ruby/ESL" +tries=10000 + +con = ESL::ESLconnection.new("localhost", "8021", "ClueCon") +e = con.sendRecv("api load mod_memcache") +puts e.getBody() +e = con.sendRecv("api reload mod_memcache") +puts e.getBody() +puts "Calling various memcache apis #{tries} times" +tries.times do |try| + if (try % 100 == 0) then + puts try + end + e = con.sendRecv("api memcache add foo a#{try}") + e = con.sendRecv("api memcache set foo s#{try}") + e = con.sendRecv("api memcache replace foo r#{try}") + e = con.sendRecv("api memcache get foo #{try}") + e = con.sendRecv("api memcache increment foo") + e = con.sendRecv("api memcache decrement foo") + e = con.sendRecv("api memcache delete foo") +end + +e = con.sendRecv("api memcache flush") +e = con.sendRecv("api memcache status verbose") +puts e.getBody()