Skip to content
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

Merged
merged 15 commits into from
Sep 14, 2016

Conversation

RafalWilinski
Copy link
Owner

@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-0993a84563cc77372e1130817c9d25bbR244

Please do some code review if you have free time, thanks.

@RafalWilinski
Copy link
Owner Author

@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>
Copy link
Owner Author

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

Copy link
Collaborator

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');
Copy link
Collaborator

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)"

@mattiaerre
Copy link
Collaborator

also I still have got "Chart.bundle.min.js:15 Uncaught TypeError: Cannot read property '_view' of undefined" sometimes 😭

@mattiaerre
Copy link
Collaborator

I like the Status codes chart btw; very nice feature 👍

screen shot 2016-09-12 at 23 27 34

const interval = 50;

const makeDummyCall = () => setTimeout(() => {
const code = 200 + Math.random() * 399;
Copy link
Collaborator

@mattiaerre mattiaerre Sep 13, 2016

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 😅

Copy link
Owner Author

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.

@RafalWilinski RafalWilinski self-assigned this Sep 13, 2016
@@ -3,10 +3,14 @@
const express = require('express');

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lovely 👍

@mattiaerre
Copy link
Collaborator

mattiaerre commented Sep 13, 2016

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

@RafalWilinski
Copy link
Owner Author

Really? even after latest commit? This is really strange to me.

@RafalWilinski RafalWilinski merged commit 5a39b44 into master Sep 14, 2016
@RafalWilinski RafalWilinski deleted the status-codes branch September 14, 2016 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants