[collectd] memcached:// support in curl plugin

Doug MacEachern dougjm at gmail.com
Wed Mar 4 06:09:38 CET 2009

Hi Florian,

On Feb 27, 2009, at 4:32 AM, Florian Forster wrote:

> Good morning,
> On Thu, Feb 26, 2009 at 06:29:56PM -0500, Doug MacEachern wrote:
>> Similar idea to plugging a struct Curl_handler into libcurl, but  
>> since
>> we can't do that have own layer to do something like:
>> register_url_handler(const char *scheme, int (*callback) (web_page_t
>> *wp));
> I always thought of cURL as an abstraction layer over (possibly  
> network
> based) file access operations. Putting another abstraction layer over
> that is, in my opinion, not the way to go. I'd much rather see libcurl
> provide a schema registration function in the future and/or (if they
> oppose that for some reason), include `memcached' support there.

I'm with you on that, agreed.

> Did you talk to the cURL guys already? I didn't find any (recent) post
> in the `curl-library' mailing list at least.. If not, I'd be  
> willing to
> write and submit patches for both suggestions..

Nope I didn't post to any of the cURL lists,  mainly because it  
looked very much intentional having them all static to url.c.  If you  
want to make the proposal/patch there, that'd be great.

>> What do you think, should I just implement memcachec as its own  
>> plugin
>> and leave curl.c alone?
> I've put your changes into a separate plugin, but unfortunately I
> couldn't delete as much code as I had hoped, so I'm not 100%  
> satisfied.
> I'll send an email with the patch in a minute..

Looks great, thanks!  I feel guilty not having done the work myself,  
but less so since you agree we should be able to shrink it more ;)

> But I've thought of a third option: Using the libmemcached (or the
> libmemcache, which is a different library!) you can get statistics  
> *and*
> actual payload. Maybe it'd make sense to put both options, getting
> general memcache *daemon* statistics and getting data from the  
> daemon to
> *parse* statistics, into one plugin. What do you think?

Hmm, didn't know about libmemcache, but it seems both authors have  
agreed on libmemcached:
But yes, it probably would make sense for the existing memcached.c  
plugin to use libmemcached if available and also to support the  
custom payload based stats.
So where do we go from here on this?  I'm happy to take your  
direction and work on the implementation.  But have no problem of  
course if you want to run with it, in which case I'll move on to  
another unrelated patch :)

More information about the collectd mailing list