- NodeJS 10.x
- Python 3.x
- Twisted module
pip install Twisted
- git clone {this repository}
- Go to root level of the cloned repo and
npm install
, and start the node server withnpm run start
- cd into frontend folder and npm install, and start webpack server with
npm run start-dev
Proceed to http://localhost:3000
- Implemented using websockets, Node server pushes data at a one second interval at a lower overhead cost than continous http polling
const pollingHelper = () => {
request("http://127.0.0.1:12345", (error, response, body) => {
//Emit statusCode, and timestamp to front-end
socket.emit("dataPoint", {
timestamp: Date.now(),
status: response.statusCode
});
});
};
- Used a charting library to graph / table continous data
- Since data is updated approximately once per second, I used this approximation to store at most 300 ( 5 (minutes) * 60 seconds == 300 seconds) data points.
insertIndex = counter % 300
counter = (counter + 1) % 300
Once all 300 slots in the array are filled, the next entry will be at index 0, and then 1,2,3,etc... Such that the oldest points get overwritten.
- Still in progress. Ran into some issues with environment configuration, and deployment.
- After cloning,
cd frontend
andnpm run test
(babel issue currently)