X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fsimulator-group%2Fsim-monitor.js;h=aabc7d72bab6d1cb0cfd5f6ab10e0b9a1560c3f9;hb=b0cd302e1d3adaec4335226d34a36edc9410fd65;hp=7a220263ad1c3ac397f0dc1e35f4a556b258ae5f;hpb=f0a158c3c32b6547c839c559548e4e4b729802e1;p=nonrtric.git diff --git a/test/simulator-group/sim-monitor.js b/test/simulator-group/sim-monitor.js index 7a220263..aabc7d72 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,14 @@ var refreshCount_ecs=-1 var refreshCount_cr=-1 +var refreshCount_rc=-1 + var ricbasename="ricsim" +var rc_services="" + +var pmsprefix="" + function fetchAllMetrics_pol() { console.log("Fetching policy metrics " + refreshCount_pol) @@ -711,6 +718,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 +853,6 @@ app.get("/mon2",function(req, res){ htmlStr=htmlStr+"
"; for(i=0;i" htmlStr=htmlStr+s @@ -876,27 +918,37 @@ 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 + pmsprefix=req.query.pmsprefix - if (bn == undefined) { + console.log("PMS"+pmsprefix) + if ((bn == undefined) || (pmsprefix == undefined)) { getCtr=0 - return res.redirect('/mon?basename=ricsim'); + return res.redirect('/mon?basename=ricsim&pmsprefix=/a1-policy/v2'); } else { ricbasename=bn } + //Build web page var htmlStr = "" + "" + "" + ""+ //2 sec auto refresh - "Policy Agent and simulator monitor"+ + "Policy Management Service and simulator monitor"+ "" + "" + "" + "

Change basename in url if other ric sim prefix is used

" + + "

Change pmsprefix in url if pms with other prefix is used

" + "
" + - "

Policy agent

" + + "

Policy Management Service

" + "" + "Status:..............................." + formatDataRow(ag1) + "
" + "Services:............................." + formatIdRowCompact(ag2) + "
" + @@ -913,13 +965,17 @@ app.get("/mon",function(req, res){ "Fetched responses.............................." + formatDataRow(mr5) + "
" + "Current responses waiting......................" + formatDataRow(mr6) + "
" + "
"+ - "

Callback receiver

" + + "

Callback|Notification receiver

" + "" + "Callbacks received:..................." + formatDataRow(cr1) + "
" + "Callbacks fetched:...................." + formatDataRow(cr2) + "
" + "Number of waiting callback messages:.." + formatDataRow(cr3) + "
" + "
" + - "

Near-RT RIC Simulators

" + + "

R-APP Catalogue

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

Near-RT RIC | A1 Simulators

" + "" htmlStr=htmlStr+padding("Near-RT RIC Simulator name", 35," ")