1
0
mirror of https://github.com/yldio/copilot.git synced 2024-09-21 22:03:54 +03:00
copilot/spikes/graphs-matrix/epoch/server/routes/metrics.js
2016-11-09 13:28:26 +00:00

19 lines
423 B
JavaScript

const Metric = require('../metric');
module.exports = (server) => {
const metric = Metric(server);
server.subscription('/stats/{id}', {
onSubscribe: (socket, path, params, next) => {
console.log('onSubscribe');
metric.on(params.id);
next();
},
onUnsubscribe: (socket, path, params, next) => {
console.log('onUnsubscribe');
metric.off(params.id);
next();
}
});
};