Comparing version 0.1.0 to 1.1.0
25
index.js
@@ -7,2 +7,15 @@ /*jshint node:true, laxcomma:true */ | ||
function _clean (str) { | ||
str = str.toLowerCase(); | ||
// convert all periods and spaces into underscore | ||
// related: https://github.com/square/cube/issues/95 | ||
str = str.replace(/[\.\s]/g, '_'); | ||
// remove all remaining non-alpha, non-numeric, non-underscore chars | ||
str = str.replace(/[^_a-zA-Z\d:]/g, ''); | ||
return str; | ||
} | ||
function CubeBackend (startupTime, config, emitter){ | ||
@@ -34,3 +47,3 @@ var self = this; | ||
this.cube.send({ | ||
type: counterEvent, | ||
type: _clean(counterEvent), | ||
data: {c: metrics.counters[counterEvent]} | ||
@@ -45,3 +58,3 @@ }); | ||
this.cube.send({ | ||
type: guageEvent, | ||
type: _clean(guageEvent), | ||
data: {g: metrics.gauges[guageEvent]} | ||
@@ -56,3 +69,3 @@ }); | ||
this.cube.send({ | ||
type: timerEvent, | ||
type: _clean(timerEvent), | ||
data: {ms: metrics.timer_data[timerEvent]} | ||
@@ -77,3 +90,3 @@ }); | ||
this.cube.send({ | ||
type: setEvent, | ||
type: _clean(setEvent), | ||
data: {s: _sets[setEvent]} | ||
@@ -91,2 +104,6 @@ }); | ||
exports.__test = { | ||
_clean: _clean | ||
}; | ||
exports.init = function (startupTime, config, emitter) { | ||
@@ -93,0 +110,0 @@ var instance = new CubeBackend(startupTime, config, emitter); |
{ | ||
"name": "cubed", | ||
"version": "0.1.0", | ||
"description": "a super-simple backend for statsd; relays statsd events to a cube instance via udp", | ||
"version": "1.1.0", | ||
"description": "a super simple backend for statsd; relays statsd events to a cube instance via udp", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "" | ||
"test": "node test" | ||
}, | ||
@@ -9,0 +9,0 @@ "dependencies": { |
@@ -73,3 +73,3 @@ cubed | ||
cube automatically manages the `keiju_metrics` colleciton. the following evaluator request would sum the received counts at 1 minute intervals (remember: cube's evaluator uses [fixed resolution times](https://github.com/square/cube/wiki/Evaluator)). | ||
cube automatically manages the related `keiju_metrics` colleciton. the following evaluator request would sum the received counts at 1 minute intervals (remember: cube's evaluator uses [fixed resolution times](https://github.com/square/cube/wiki/Evaluator)). | ||
@@ -101,7 +101,18 @@ ``` | ||
## namespacing statsd -> cube | ||
in statsd, periods are used to namespace events. unfortunately, cube [does not (yet) support periods](https://github.com/square/cube/issues/95) in event names though they are [valid collection names](http://docs.mongodb.org/manual/faq/developers/). (hopefully this is patched soon...) | ||
for now, all periods (and spaces) are converted to underscores. then, all non-alphanumeric or non-underscore characters are removed. | ||
## tests | ||
coming soon? use with caution. | ||
work in progress. use with caution. | ||
``` | ||
npm test | ||
``` | ||
## no tcp? | ||
@@ -114,4 +125,6 @@ | ||
the future of cube and statsd is uncertain. indeed, that is the fate of all software. however, at present, our team has found the cube evaluator to be one of the more robust options available--after you master the slightly unusual [metric expression syntax](https://github.com/square/cube/wiki/Queries#wiki-metric). in addition, statsd is both fast and robust for bursted statistical analysis. they are both also rediculously easy to integrate into node applications or any udp-enabled service. | ||
the future of cube and statsd is uncertain. indeed, that is the fate of all software. however, at present, our team has found the cube evaluator to be one of the more robust options available--after you master the slightly unusual [metric expression syntax](https://github.com/square/cube/wiki/Queries#wiki-metric). | ||
graphite (which uses carbon) is an incredibly powerful solution. however, the ui and authorization strategies need some tlc. installing graphite is a bit rough-and-tumble and an adventure in python package dependencies. as an alternative, we are building rubyx (repo link coming soon) -- a stunningly simple node app and modern ui for interacting with cubed stats. | ||
in addition, the recent [infochimps merge](https://github.com/square/cube/pull/129) into `cube/master` has only increased our appreciation for cube and its maintainers. statsd is, as advertised, both fast and robust for bursted statistical analysis. they are both also rediculously easy to integrate into node applications or any udp-enabled service. | ||
graphite (which uses carbon) is an incredibly powerful solution. however, the ui and authorization strategies need some tlc. installing graphite is a bit rough-and-tumble and an adventure in python package dependencies. |
Sorry, the diff of this file is not supported yet
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
9725
6
92
1
127