[collectd] unixsock-like plugin extension
octo at verplant.org
Sat Jun 12 10:56:08 CEST 2010
On Fri, Jun 04, 2010 at 12:39:47PM -0700, Shaun Lindsay wrote:
> So, I wrote a plugin I'm calling aggregator to do handle this sort of
> use case.
what you're describing sounds a lot like the "Event infrastructure", an
idea that has been floating around for a long time by nobody actually
implemented it yet.
The idea was to implement a new command in the "UnixSock" plugin with
the following syntax:
EVENT <Name> [<Number>]
When this command is received, the "UnixSock" plugin looks up the
structure called <Name> or allocates it if necessary. If a <Number> is
given, the number is added to a counter in the structure, otherwise the
counter is increased by one.
So, for example, if a web-application issues
after each page served, you'll end up with a graph showing the pageviews
A possible extension would be to allow the user to specify a "data
set" / "type" to use. The same web-application could, for example, issue
EVENT type="total_bytes" "pages" 18063
to use the "total_bytes" data set and add 18 kByte to the current
> Again due to my particular use case, it needed to be able to handle a
> large number of concurrent connections (50k potentially), so rather
> than spawning a thread per connection ala unixsock, I kick off one
> thread when the plugin init's and then run a libevent server inside
> that thread and do everything asynchronously.
I think it might be possible to incorporate that into the "UnixSock"
plugin, either as a compile-time or run-time choice. We could, for
example, use libevent if it is available and fall back to the current
> So, then, two questions: First, did I just reinvent the wheel on
> this? Is there a plugin that already satisfies this sort of need?
No. The idea is not new, but there is not code in the daemon / plugins
> Second, if this is new, is anyone else interested in this sort of
Florian octo Forster
Hacker in training
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20100612/e8d395dd/attachment.pgp
More information about the collectd