Authored by htoooth

fix

... ... @@ -21,20 +21,40 @@ const server = {
if (duration > config.slowRoute.min || duration < config.slowRoute.max) {
slowRouterSender.addMessage(msg2row.slowRouter(m));
}
influxSender.addMessage({
measurement: 'route-info',
tags: {
app: m.tags.app,
hostname: m.tags.hostname,
route: m.tags.route
},
fields: {
duration: m.duration
}
});
if (m.tags.type.toLowerCase() === 'api') {
influxSender.addMessage({
measurement: 'api-info',
tags: {
app: m.tags.app,
hostname: m.tags.hostname,
api: m.tags.api
},
fields: {
duration: m.duration,
times: 1
}
});
}
if (m.tags.type.toLowerCase() === 'route') {
influxSender.addMessage({
measurement: 'route-info',
tags: {
app: m.tags.app,
hostname: m.tags.hostname,
route: m.tags.route
},
fields: {
duration: m.duration
}
});
}
} else if (m.measurement === 'error-report') {
errorSender.addMessage(msg2row.errorRouter(m));
} else if (m.measurement === 'process-info') {
influxSender.addMessage(m);
}
}
}
... ...