-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce Status Codes chart & fix undefined _view error in Chart.js #52
Conversation
@soyuka I'd be glad if you could also take a look. |
<h6 style="color: #75D701">2xx</h6> | ||
<h6 style="color: #47b8e0">3xx</h6> | ||
<h6 style="color: #ffc952">4xx</h6> | ||
<h6 style="color: #E53A40">5xx</h6> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inline styles are bad, I know, I'm lazy. Also, i think there's better solution to unify them with these in JS file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why you are not adding 4 classes to the existing style.css file?
/src/public/stylesheets/style.css
.status-code-2xx {
color: #75D701;
}
.status-code-3xx {
color: #47b8e0;
}
.status-code-4xx {
color: #ffc952;
}
.status-code-5xx {
color: #E53A40;
}
/src/public/index.html
<h5>Status Codes</h5>
<h6 class="status-code-2xx">2xx</h6>
<h6 class="status-code-3xx">3xx</h6>
<h6 class="status-code-4xx">4xx</h6>
<h6 class="status-code-5xx">5xx</h6>
@@ -1,12 +1,15 @@ | |||
/* eslint no-console: "off" */ | |||
|
|||
const express = require('express'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: you need to keep the 1 line space otherwise the eslinter will complain: "[eslint] Expected empty line after require statement not followed by another require. (import/newline-after-import)"
also I still have got "Chart.bundle.min.js:15 Uncaught TypeError: Cannot read property '_view' of undefined" sometimes 😭 |
const interval = 50; | ||
|
||
const makeDummyCall = () => setTimeout(() => { | ||
const code = 200 + Math.random() * 399; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: what about this in order to retrieve a "real" random http status code?
const randomHttpStatusCode = _.sample(_.invert(http.STATUS_CODES));
n.b. actually I think I am going to create a npm package that does that 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I have to create better legend for that.
@@ -3,10 +3,14 @@ | |||
const express = require('express'); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lovely 👍
hi @RafalWilinski all LGTM, but TBF I still have got sometimes: "Chart.bundle.min.js:15 Uncaught TypeError: Cannot read property '_view' of undefined"; on the other hand the "benchmark" script doesn't crash anymore 👍 I am still thinking of course about decomposing app.js BTW 😅 from my POV you can merge it, thanks // cc @soyuka |
Really? even after latest commit? This is really strange to me. |
@mattiaerre - As I said before, here are status codes charts.
As a "by product", I found root cause of issues #6 and #4
Sometimes, two consecutive messages had same timestamp so
deltaTime
was zero, fix is here: https://github.com/RafalWilinski/express-status-monitor/compare/status-codes#diff-0993a84563cc77372e1130817c9d25bbR244Please do some code review if you have free time, thanks.