mcinsight

2,273 views
Skip to first unread message

andrewfromgeni

unread,
Jul 12, 2008, 3:51:34 PM7/12/08
to memcached
After learning how to use Cocoa classes, I started to write
"mcinsight"
(mem cache insight).
The idea is to run this stand alone mac application on your dev
system
instead of a real memcached server. When you launch it, it opens a
socket
server on port 11211 (default memcached port) and does everything a
real
memcached does but with a GUI on top.

You can see every key, click on it and see it's value, it's size,
etc.
You'll be able to sort by keyname, expiring time, etc.

Sorry, no windows or linux version. Have to upgrade to mac.

The put a very early (pre-alpha) version on github if anyone else
would like
to try it:

http://github.com/andrewfromgeni/mcinsight/

You don't have to compile it to just run it. There is a folder
called
"executable" with a mac application you can just double click.

Feedback and feature suggestions welcome.

Thanks,
-Andrew

Ray Krueger

unread,
Jul 12, 2008, 5:12:28 PM7/12/08
to memc...@googlegroups.com
This sounds really cool. I'll play around with this when I get back to
the office where my mac is :P

Joseph Engo

unread,
Jul 12, 2008, 5:29:17 PM7/12/08
to memc...@googlegroups.com
Very nice! However, looking at the values PHP is setting they are
unreadable (from the interface, not sure what format they are in)

I am going to pass this along to the engineers I work with, they will
find it very useful.

---
http://linkped.com - Get that link I sent ya ?


andrewfromgeni

unread,
Jul 12, 2008, 6:02:29 PM7/12/08
to memcached
Right now it just displays the values as binary data in hex format.
We use ruby at
geni so ruby's Marshal.dump call puts binary data into memcache for
us. The results are
not human readable. I'm working on making mcinsight call a ruby
interpreter to display
the values as human readable "pretty-print" ruby objects. But there
could be settings
for just plain text, or other language serialized formats.
> ---http://linkped.com- Get that link I sent ya ?

Gavin M. Roy

unread,
Jul 12, 2008, 5:44:10 PM7/12/08
to memc...@googlegroups.com
Very cool, checking it out now.

Regards,

Gavin

Jeremy Dunck

unread,
Jul 12, 2008, 6:59:22 PM7/12/08
to memc...@googlegroups.com
On Sat, Jul 12, 2008 at 5:02 PM, andrewfromgeni <one...@gmail.com> wrote:
>
> Right now it just displays the values as binary data in hex format.

It seems to have a round-tripping problem.

Using actual memcached:
>>> cache.set('k1', {'x':1}, 10000)
>>> cache.get('k1')
{'x': 1}

Using mcinsight:
>>> cache.set('k1', {'x':1}, 10000)
>>> cache.get('k1')
u"(dp0\nS'x'\np1\nI1\ns."


OS X 10.5.4; I'm not sure what other system info would be relevant.

andrewfromgeni

unread,
Jul 12, 2008, 8:17:00 PM7/12/08
to memcached
I just tried your example in script/console from a rails app:

>> CACHE.set('k1', {'x'=>1}, 10000)
>> CACHE.get('k1')
=> {"x"=>1}

and I get the hash back fine. Is {'x':1} python notation? What
language are you using?

The biggest un-stable part of the code now is it only works for one
client at a time. Fine
for the solo developer working on his system only. But it's not gonna
work yet as a memcache
server with X number of simultaneous clients. It will eventually,
just need to clean up the socket logic.
But maybe you are getting back the bad data because you have multiple
threads or multi clients
hitting the server?

Jeremy Dunck

unread,
Jul 12, 2008, 9:52:41 PM7/12/08
to memc...@googlegroups.com
On Sat, Jul 12, 2008 at 7:17 PM, andrewfromgeni <one...@gmail.com> wrote:
>
> I just tried your example in script/console from a rails app:
>
>>> CACHE.set('k1', {'x'=>1}, 10000)
>>> CACHE.get('k1')
> => {"x"=>1}
>
> and I get the hash back fine. Is {'x':1} python notation? What
> language are you using?

I am indeed using Python. This is with the bare memcache.py library:
In [5]: c=memcache.Client(servers=['127.0.0.1'])
In [6]: c.set('x', {'x':1}, 10000)
...
In [7]: c.get('x')
Out[8]: "(dp0\nS'x'\np1\nI1\ns."

Andrew Arrow

unread,
Jul 13, 2008, 10:28:54 AM7/13/08
to memcached
Okay this has been fixed and pushed to github.

The issue was the "flag" field. Ruby ignores it, so I had it set to
always zero.
Python uses it to denote if data should be marshaled. I changed the
code
to correctly send back the right flag.

Jeremy Dunck

unread,
Jul 15, 2008, 6:12:41 PM7/15/08
to memc...@googlegroups.com
On Sun, Jul 13, 2008 at 9:28 AM, Andrew Arrow <one...@gmail.com> wrote:
>
> Okay this has been fixed and pushed to github.
>
> The issue was the "flag" field. Ruby ignores it, so I had it set to
> always zero.
> Python uses it to denote if data should be marshaled. I changed the
> code
> to correctly send back the right flag.


Indeed, worksforme now.

I assume you'd take contributions?

We generally store stuff pickled (that is, serialized using the python
pickle module), which means the value shown in the UI isn't terribly
useful. I'd like to be able to have some sort of plugin to
deserialize the values in the UI.

Andrew Arrow

unread,
Jul 15, 2008, 6:47:48 PM7/15/08
to memcached
Sure, contributions welcome. I started a dropdown menu with:

1. Hex
2. Plain Text
3. Ruby Objects

and Hex and Plain Text are working. I need to do the same
deserialized logic for Ruby before Ruby Objects will work.
Go ahead and add:

4. Python Objects

to the drop down if you'd like.
Reply all
Reply to author
Forward
0 new messages