X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fsimulator-group%2Fsim-monitor.js;h=9a0616d508b07122bb9776cb6a059c7b0daf01bc;hb=de4d0f86a327469fb64645c2bcd3aeea7832ad25;hp=7a220263ad1c3ac397f0dc1e35f4a556b258ae5f;hpb=5343c3097bd7ae1c1c8d5f0409803c0c60034805;p=nonrtric.git diff --git a/test/simulator-group/sim-monitor.js b/test/simulator-group/sim-monitor.js index 7a220263..9a0616d5 100644 --- a/test/simulator-group/sim-monitor.js +++ b/test/simulator-group/sim-monitor.js @@ -26,6 +26,7 @@ var AGENT_PORT="8081" var CR_PORT="8090" var ECS_PORT="8083" var PRODSTUB_PORT="8092" +var RC_PORT="8680" var http = require('http'); @@ -212,8 +213,12 @@ var refreshCount_ecs=-1 var refreshCount_cr=-1 +var refreshCount_rc=-1 + var ricbasename="ricsim" +var rc_services="" + function fetchAllMetrics_pol() { console.log("Fetching policy metrics " + refreshCount_pol) @@ -711,6 +716,42 @@ function fetchAllMetrics_cr() { }, 500) } +function fetchAllMetrics_rc() { + + console.log("Fetching RC services - timer:" + refreshCount_ecs) + + if (refreshCount_rc < 0) { + refreshCount_rc = -1 + return + } else { + refreshCount_rc = refreshCount_rc - 1 + } + setTimeout(() => { + + if (checkFunctionFlag("rc_stat")) { + getSimCtr(LOCALHOST+RC_PORT+"/services", 0, function(data, index) { + var tmp_serv="" + try { + var jd=JSON.parse(data); + for(var i=0;i 0) { + tmp_serv=tmp_serv+"," + } + tmp_serv=tmp_serv+jd[i]["name"] + } + + } + catch (err) { + tmp_serv="no_response" + } + rc_services=tmp_serv + }); + clearFlag("rc_stat") + } + fetchAllMetrics_rc(); + }, 500) +} + // Monitor for CR db app.get("/mon3",function(req, res){ @@ -810,7 +851,6 @@ app.get("/mon2",function(req, res){ htmlStr=htmlStr+"
"; for(i=0;i" htmlStr=htmlStr+s @@ -876,6 +916,12 @@ app.get("/mon",function(req, res){ } refreshCount_pol=5 + if (refreshCount_rc < 0) { + refreshCount_rc=5 + fetchAllMetrics_rc() + } + refreshCount_rc=5 + var bn=req.query.basename if (bn == undefined) { @@ -919,6 +965,10 @@ app.get("/mon",function(req, res){ "Callbacks fetched:...................." + formatDataRow(cr2) + "
" + "Number of waiting callback messages:.." + formatDataRow(cr3) + "
" + "" + + "

R-APP Catalogue

" + + "" + + "Services:............................." + formatIdRowCompact(rc_services) + "
" + + "
" + "

Near-RT RIC Simulators

" + ""