get real time cpu usage of remote server
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- javascript, node.js, typescript
Research direction
No repository file or test is named. Start by reproducing the repeated responses around the connection's ready handler, the get_live_usage event, and the client-side getNewSeries function; clarify whether one client emission should produce exactly one usage response before defining completion criteria.
Written by the indexing model from the issue text.
Description
hello I am trying to use ssh2 with websocket , so I can get REAL Time cpu usage , this is my code
conn.connect({
host: '127.0.0.1',
port: 22,
username: 'muhammed',
password:"Muhbu2020"
});
conn.on("ready", () => {
routerconnection.usagemonitor.channel.to(namespace).emit('ready_to_get_data');
socket.on("get_live_usage",function(){
conn.exec('cat /proc/stat', (err, stream) => {
if (err) throw err;
stream.on('data', (data) => {
console.log("recieving data");
handleMonitorResponse(routerconnection,router_id,data.toString());
})
});
});
});
actually what isgoing on is when I am emmiting get_live_usage to node js from javascript ,the server start to run a lot of instance and it return a lot of response for one emmit , which making my chart going crazy , did I missed somethings or what , I don't understand ,
this is my client side code
socket.on('live_usage',function (recieved) {
console.log("recieved"+ recieved.load)
getNewSeries(lastDate, {
min: 0,
max: 100
},recieved)
resetData()
chart.updateSeries([{
data: data
}])
});
and this is the getNewSeries function
function getNewSeries(baseval, yrange,recieved) {
console.log(recieved)
var newDate = baseval + TICKINTERVAL;
lastDate = newDate
for(var i = 0; i< data.length - 100; i++) {
// IMPORTANT
// we reset the x and y of the data which is out of drawing area
// to prevent memory leaks
data[i].x = newDate - XAXISRANGE - TICKINTERVAL
data[i].y = 0
console.log("weeeeeeare in for")
}
window['status'+admin_id+nas_id] =0;
cpu = recieved.load
var iowait = recieved.iowait;
$('#iobar').attr('style', "width:" + iowait + "%");
$('#iobar').html(iowait + "%")
$('#cpubar').attr('style', "width:" + cpu + "%");
$('#cpubar').html(cpu + "%")
$('#cpu-usage').html(cpu + "%")
socket.emit('get_live_usage', detail);
data.push({
x: newDate,
y: cpu
})
}
- Dominant language
- TypeScript
- Stars
- 1k
- Forks
- 94
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from steelbrain/node-ssh
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
steelbrain/node-ssh#487 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
steelbrain/node-ssh#482 · 3 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
steelbrain/node-ssh#474 · 3 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
steelbrain/node-ssh#473 · 1 comment · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 20/100
steelbrain/node-ssh#472 ·
All issues in steelbrain/node-ssh
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
cli: `execCargoMetadata` decodes stdout per chunk, corrupting non-ASCII paths across pipe boundariesOpen
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 62/100
lingdojo/kana-dojo#34127 · 1 comment · 5 reactions ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
osmlab/name-suggestion-index#13104 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100