diff --git a/swarmlab-app/src/run/app.js b/swarmlab-app/src/run/app.js index fa99f476..f8aba302 100644 --- a/swarmlab-app/src/run/app.js +++ b/swarmlab-app/src/run/app.js @@ -117,19 +117,32 @@ app.get("/length", cors(corsOptions), (req, res) => { var mongol = 0; var mongolerror = 0; var redis = 0; + var dumout = 0; + var dumerr = 0; obj.forEach((value) => { if (value.container_name == "/mongo") { var tmp = JSON.parse(value.log); if (tmp.s == "I") mongol++; // count every informative log as an output log else if (tmp.s == "W" || tmp.s == "E") mongolerror++; //count every warning and error log - } else if (value.log.includes("app_name")) { + } else if ( + value.container_name == "/readmongo_service" && + value.log.includes("app_name") + ) { var test = JSON.parse(value.log); var type = test.type; if (type == "err") apperror++; else appout++; } else if (value.container_name == "/redisserver") { redis++; + } else if ( + value.container_name == "/dummy_service" && + value.log.includes("app_name") + ) { + var test = JSON.parse(value.log); + var type = test.type; + if (type == "err") dumerr++; + else dumout++; } }); var RES = new Object(); @@ -139,6 +152,8 @@ app.get("/length", cors(corsOptions), (req, res) => { appout: appout, apperror: apperror, redis: redis, + dumout: dumout, + dumerr: dumerr, }; RES.data = data; @@ -171,7 +186,7 @@ app.get("/test", cors(corsOptions), (req, res) => { obj.forEach((value) => { if (value.container_name == "/redisserver") { // jsonfinal.push(JSON.parse(value.log)); - jsonfinal.push(value.log); + jsonfinal.push(value); } else if (value.container_name == "/mongo") { mongo.push(JSON.parse(value.log)); } else if (value.log.includes("app_name")) { @@ -224,7 +239,35 @@ app.get("/test2", cors(corsOptions), (req, res) => { tmp.type = '