Hello Memcached And CactiTemplate people,

I tried out a simple test

Server :  sudo memcached -m 64 -p 11211 -U 11211 -u nobody
Client : SuperCache extends MemcacheClient where I have "import
net.spy.memcached.MemcachedClient;"
Expected : Current Items graph (on cacti) to show some items, but shows 0.
This makes debugging impossible.

package test.com.mcruiseon.server;
import org.junit.Before;
import org.junit.Test;
import com.mcruiseon.server.SuperCache;
import junit.framework.TestCase;
public class TestMemcached extends TestCase {
private SuperCache superCache;

@Before
public void setUp() throws Exception {
superCache = SuperCache.getInstance();
}

@Test
public void testMemcached() {
for (int i = 0; i < 1000; i++) {
String key = new Integer(i).toString();
Integer value = new Integer(i);
superCache.add(key, 600, value);

Integer cacheValue = (Integer) superCache.get(key);
assertTrue(value.intValue() == cacheValue.intValue());
}
}
}


On Mon, Nov 28, 2011 at 6:55 PM, MCON Dev <[email protected]> wrote:

> Hello All,
>
> I have just started using memcached. I have setup my server and the cacti
> graph reporting environment. The reports seem to show some activity,
> memory usage shows red and orange
> load average shows red and orange
> logged in users blue (1)
> processes 200
> "current items" shows nothing
>
> Nor are my get's successful
>
> Code
> cache.set(key, EXPIRY, (Object)row) ;
> OR
> cache.add(key, EXPIRY, (Object)row) ;
> int EXPIRY = 60*60*24*30*12 ; // 1 year
> key value = "-149282939"
> Object = "hibernate table object"
>
> Question is how to debug if memcached has this value (for a particular
> key) or not. With mySql you can do a simple db query to find out. Please
> advice.
>
> Regards
> Conny
>

Reply via email to