Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/segment-boneyard/metrics-redis
A metrics plugin to save/load keys in redis
https://github.com/segment-boneyard/metrics-redis
Last synced: about 7 hours ago
JSON representation
A metrics plugin to save/load keys in redis
- Host: GitHub
- URL: https://github.com/segment-boneyard/metrics-redis
- Owner: segment-boneyard
- Created: 2015-01-09T22:33:21.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-06-29T03:29:16.000Z (over 9 years ago)
- Last Synced: 2024-04-24T21:01:22.872Z (7 months ago)
- Language: JavaScript
- Size: 164 KB
- Stars: 3
- Watchers: 49
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
Awesome Lists containing this project
README
# metrics-redis
A [segmentio/metrics](https://github.com/segmentio/metrics) plugin to save and load metrics from a [Redis](http://redis.io/) db.
## Installation
$ npm install metrics-redis
## Example
```js
var Metrics = require('metrics');
var save = require('metrics-redis');
var Redis = require('redis');
var redis = Redis.createClient();var metrics = Metrics()
.use(save(redis))
.every('10m', charges('stripe-key')
.every('10m', subscriptions('stripe-key')
.every('1d', awsBilling(accountId, key, secret, bucket, region))
.every('10m', helpscout('helpscout-key', ['mailbox']));
```The plugin will query set`metrics:keys`, and load all of the metric values set at those keys. For example:
```js
metrics:keys = ["stripe subscriptions"]
metrics:stripe subscriptions = { '1420840090802': 30, '1420840090802': 43 }
```The plugin will listen for all change events and save each change into the redis db.
## License
MIT