Commit c715eb21 authored by Alexandra Rogova's avatar Alexandra Rogova

Test

/reviewed-on !2
parents bd394892 11d6ef9c
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -19,7 +19,7 @@ function init_monitor(){ ...@@ -19,7 +19,7 @@ function init_monitor(){
var server = net.createServer(function(socket) { var server = net.createServer(function(socket) {
socket.on("data", function(data){ socket.on("data", function(data){
diskspace.check("/", function(err, result){ diskspace.check("/", function(err, result){
var disk_used = result.used - start_disk; var disk_used = Math.max(result.used - start_disk, 0);
var ram_used = data; var ram_used = data;
stream.write(Date.now() + "," + ram_used + "," + disk_used + "\n"); stream.write(Date.now() + "," + ram_used + "," + disk_used + "\n");
}); });
...@@ -40,7 +40,7 @@ process.on("exit", function(){ ...@@ -40,7 +40,7 @@ process.on("exit", function(){
monitor.kill(); monitor.kill();
}) })
diskspace.check("C", function (err, result){ diskspace.check("/", function (err, result){
start_disk = result.used; start_disk = result.used;
init_monitor(); init_monitor();
}); });
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment