Showing
1 changed file
with
16 additions
and
1 deletions
@@ -16,9 +16,10 @@ const server = { | @@ -16,9 +16,10 @@ const server = { | ||
16 | let msgs = lineparse.parse(data); | 16 | let msgs = lineparse.parse(data); |
17 | 17 | ||
18 | for (let m of msgs) { | 18 | for (let m of msgs) { |
19 | - if (m.measurement === 'web-server-duration') { | ||
20 | let duration = parseInt(m.fields.duration); | 19 | let duration = parseInt(m.fields.duration); |
21 | 20 | ||
21 | + if (m.measurement === 'web-server-duration') { | ||
22 | + | ||
22 | if (duration > config.slowRoute.min && duration < config.slowRoute.max) { | 23 | if (duration > config.slowRoute.min && duration < config.slowRoute.max) { |
23 | slowRouterSender.addMessage(msg2row.slowRouter(m)); | 24 | slowRouterSender.addMessage(msg2row.slowRouter(m)); |
24 | } | 25 | } |
@@ -50,6 +51,20 @@ const server = { | @@ -50,6 +51,20 @@ const server = { | ||
50 | }); | 51 | }); |
51 | } | 52 | } |
52 | } else if (m.measurement === 'error-report') { | 53 | } else if (m.measurement === 'error-report') { |
54 | + routeSender.addMessage({ | ||
55 | + measurement: 'error-info', | ||
56 | + tags: { | ||
57 | + app: m.tags.app, | ||
58 | + host: m.tags.hostname, | ||
59 | + route: m.tags.route, | ||
60 | + code: m.tags.code | ||
61 | + }, | ||
62 | + fields: { | ||
63 | + duration: duration, | ||
64 | + times: 1 | ||
65 | + } | ||
66 | + }); | ||
67 | + | ||
53 | errorSender.addMessage(msg2row.errorRouter(m)); | 68 | errorSender.addMessage(msg2row.errorRouter(m)); |
54 | } else if (m.measurement === 'process-info') { | 69 | } else if (m.measurement === 'process-info') { |
55 | m.measurement = 'process-info'; | 70 | m.measurement = 'process-info'; |
-
Please register or login to post a comment