GraphiteD - An Exploration of HostedGraphite.com Using ColdFusion
GraphiteD is a dumbed-down exploration of the Graphite SaaS, HostedGraphite.com, written in ColdFusion. The root component, GraphiteD.cfc, buffers metrics (somewhat similar to the way that StatsD would) before flushing them to HostedGraphite.com over UDP (with a fallback to HTTP). Since there is no external service running, GraphiteD.cfc depends on continuous use in order to flush the buffered metrics.
To instantiate the GraphiteD component, all you need to do is pass it your HostedGraphite.com API key:
- GraphiteD( apiKey [, interval [, maxUdpPayloadSize ] ] );
... then, to start logging metrics, you can use one of the three recording methods:
- recordCounterMetric( name, value );
- recordGaugeMetric( name, value );
- recordTimerMetric( name, value );
Why This Is Not As Good As StatsD
This was intended as an exploration of the Graphite SaaS HostedGraphite.com; it was not intended to replace the use of the StatsD Node.js daemon (by Etsy). This ColdFusion component has a number of inherit limitations:
- Due to the use of shared memory space, it has to implement locking. Granted, the locking is extremely light-weight; but, it is locking nonetheless. It would be better to defer locking to a Node.js daemon outside of the ColdFusion workflow.
- Since the metrics cache is inside of a ColdFusion component instance, it cannot aggregate stats across different instances of ColdFusion on different machines in the same application.
That said, I guess the benefit of GraphiteD is that you don't have to have Node.js installed in order to run StatsD.