Closed xamfy closed 2 years ago
Hi @xamfy I would like to take this issue, Could you please assign it to me and explain little more about this issue.
Assigned it to you.
Basically we want to do the same thing that we talked about in the websocket task, but here it's just a GET API endpoint, to fetch the server stats (like cpu usage, memory usage, cpu load). We can start with these three first and then take it from there at a later point or discuss in the PR.
The response will be JSON. If you're familiar with react, you can even showcase the response in form of a dashboard, I can setup a separate repo for that, which will basically act as a frontend for x-server-stats(for REST API responses, websocket and server sent event responses).
Sample response:
{
"result": true,
"data": {
"cpuLoad": "XYZ",
"memoryUsage": "XYZ",
"loadAverage": "XYZ"
}
}
Result will be false, if any error occurred, and true in case of success. We want to wrap the logic of success and data in two objects namely result
and data
to maintain consistency in API reponses.
TODO: