Comparing version 0.0.0 to 0.0.1
@@ -101,3 +101,5 @@ var EventEmitter = require('events').EventEmitter | ||
this.ma.destroy() | ||
this.db.close() | ||
this.ms.close() | ||
this.agent.close() | ||
Ring.close() | ||
} | ||
@@ -104,0 +106,0 @@ |
@@ -30,3 +30,3 @@ // Copyright 2010-2014 Voxer IP LLC. All rights reserved. | ||
dirty = 0, | ||
heartbeat_timer, | ||
heartbeat_timer, reconfigure_timer, | ||
lines = new Error().stack, | ||
@@ -549,3 +549,3 @@ add_router, metrics, logger, log, warn, error; | ||
setTimeout(function () { | ||
reconfigure_timer = setTimeout(function () { | ||
reconfigure_ring(true); | ||
@@ -562,2 +562,7 @@ ring_ready = true; | ||
exports.close = function () { | ||
clearInterval(heartbeat_timer); | ||
clearTimeout(reconfigure_timer); | ||
} | ||
exports.filters = { | ||
@@ -564,0 +569,0 @@ "GET /1/rr/heartbeat": |
{ | ||
"name": "zag-daemon", | ||
"version": "0.0.0", | ||
"version": "0.0.1", | ||
"author": "sentientwaffle", | ||
@@ -5,0 +5,0 @@ "description": "aggregate metrics data", |
@@ -1,4 +0,4 @@ | ||
# zag-daemon | ||
## zag-daemon | ||
The daemons aggregate the raw points sent by `zag-agent`. | ||
The daemons aggregate the raw points sent by [`zag-agent`][agent]. | ||
@@ -8,3 +8,3 @@ It is also responsible for monitoring and alerting, though that functionality | ||
# Service setup | ||
## Service setup | ||
@@ -24,1 +24,29 @@ In order to scale, metrics data can be spread across multiple daemons that are | ||
``` | ||
## API | ||
[zag-agent][agent] uses the UDP API. | ||
### UDP | ||
The primary protocol for recording metrics is over UDP. Each daemon is running a UDP | ||
server on `options.host`. | ||
The data should be newline-delimited lines of the form: | ||
<type>:<key>=<value> | ||
where | ||
* `type` - `counter` or `histogram`. | ||
* `key` - `[>| \w/._()+:-]+` | ||
* `value` - Number. Positive or negative, integer or decimal. | ||
### HTTP | ||
#### `POST /api/metrics` | ||
The POST body should be in the same format as the UDP data. The points are | ||
recorded as the arrive, so the client can just keep sending data down a | ||
single connection instead of making repeated requests. | ||
[agent]: https://github.com/Voxer/zag/tree/master/agent |
@@ -21,2 +21,3 @@ | ||
$ ./bin/setup.js 'tcp://metrics:metricspw@192.168.203.57/metrics' prod | ||
$ ./bin/setup.js 'tcp://metrics:foo@prod-2144-internal/metrics' dev | ||
@@ -23,0 +24,0 @@ $ METRICS_HOST=http://192.168.25.195:10400 ./node_modules/stats/web/bin/admin.js tagtype list |
Sorry, the diff of this file is not supported yet
70411
2169
51