Commit b9cbc6af authored by Alexandra Rogova's avatar Alexandra Rogova

results for random paragraphs

parent aae82c0a
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -3,17 +3,13 @@ const fs = require("fs");
var diskspace = require("diskspace");
const args = require("yargs").argv;
var total_ram = os.totalmem();
var start_ram = total_ram - os.freemem();
var start_disk;
console.log(args);
var path = args.r
? "./results/add_random_csv_monitor.csv"
: "./results/add_csv_monitor.csv";
console.log(path);
? "./results/add_random_csv_monitor.csv"
: "./results/add_csv_monitor.csv";
var stream = fs.createWriteStream(path, {flags: "w+"});
stream.write("time,disk,ram\n");
stream.write("time,ram,disk\n");
//var start_disk;
// function init_server (){
// var port = 9030;
......@@ -31,8 +27,9 @@ stream.write("time,disk,ram\n");
var check = function(){
setTimeout(function () {
diskspace.check("C", function(err, result){
var disk_used = parseInt(result.used) - parseInt(start_disk);
var ram_used = total_ram - os.freemem();
//var disk_used = parseInt(result.used) - parseInt(start_disk);
var disk_used = result.used;
var ram_used = os.totalmem() - os.freemem();
stream.write(Date.now() + "," + ram_used + "," + disk_used + "\n");
check();
});
......@@ -40,7 +37,8 @@ var check = function(){
}
//init_server();
diskspace.check("C", function (err, result){
start_disk = parseInt(result.used);
check();
});
\ No newline at end of file
// diskspace.check("C", function (err, result){
// start_disk = result.used;
// check();
// });
check();
\ 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