X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=test%2Fsimulator-group%2Fsim-monitor.js;h=17d3205833e5db32307dac0f98e26fb97698f032;hb=refs%2Fchanges%2F36%2F4236%2F4;hp=d56ad7f97fbd4a500ed146978c13b77256b8b5c2;hpb=d9df6244e4ba89b71cba364f156ca529c3703faa;p=nonrtric.git diff --git a/test/simulator-group/sim-monitor.js b/test/simulator-group/sim-monitor.js index d56ad7f9..17d32058 100644 --- a/test/simulator-group/sim-monitor.js +++ b/test/simulator-group/sim-monitor.js @@ -41,7 +41,7 @@ app.get("/",function(req, res){ function getSimCtr(url, index, cb) { var data = ''; - console.log("URL: "+ url + " - ") + //console.log("URL: "+ url + " - ") try { http.get(url, (resp) => { // A chunk of data has been recieved. @@ -185,6 +185,8 @@ var getCtr=0 var refreshInterval=4000 +var ricbasename="ricsim" + function fetchAllMetrics() { setTimeout(() => { @@ -195,7 +197,7 @@ function fetchAllMetrics() { if (getCtr%3 == 0) { //Extract the port numbers from the running simulators, for every 3 calls const { exec } = require('child_process'); - exec('docker ps --filter "name=ricsim" --format "{{.Names}} {{.Ports}}" | sed s/0.0.0.0:// | cut -d \'>\' -f1 | sed \'s/[[-]]*$//\'', (err, stdout, stderr) => { + exec('docker ps --filter "name='+ricbasename+'" --format "{{.Names}} {{.Ports}}" | sed s/0.0.0.0:// | cut -d \'>\' -f1 | sed \'s/[[-]]*$//\'', (err, stdout, stderr) => { var simulators = "" simulators=`${stdout}`.replace(/(\r\n|\n|\r)/gm," "); @@ -377,6 +379,14 @@ setInterval(() => { app.get("/mon",function(req, res){ + var bn=req.query.basename + + if (bn == undefined) { + getCtr=0 + return res.redirect('/mon?basename=ricsim'); + } else { + ricbasename=bn + } refreshInterval=2000 @@ -388,6 +398,9 @@ app.get("/mon",function(req, res){ "
Change basename in url if other ric sim prefix is used
" + + "" + "