X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fsimulator-group%2Fsim-monitor.js;h=5b854149884cf534dba41df7c8b38c200c57e3e0;hb=0bfb04334ab5d9eb9b0ea573abb00eab12d9f2af;hp=e118e1751ef45ad0b50039bf0722b330b4d7fef7;hpb=520b912bce8eebb3e272c9ccfa3378b01dfd200b;p=nonrtric.git diff --git a/test/simulator-group/sim-monitor.js b/test/simulator-group/sim-monitor.js index e118e175..5b854149 100644 --- a/test/simulator-group/sim-monitor.js +++ b/test/simulator-group/sim-monitor.js @@ -24,7 +24,7 @@ var LOCALHOST="http://127.0.0.1:" var MRSTUB_PORT="3905" var AGENT_PORT="8081" var CR_PORT="8090" -var ECS_PORT="8083" +var ICS_PORT="8083" var PRODSTUB_PORT="8092" var RC_PORT="8680" @@ -186,14 +186,14 @@ var simvar4=[] var simvar5=[] var simvar6=[] -//Status variables, for parameters values fetched from ecs -var ecs1="", ecs2="", ecs3="", ecs4="", ecs_types="-", ecs_producers="-"; -var ecs_producer_arr=new Array(0) -var ecs_producer_type_arr=new Array(0) -var ecs_producer_jobs_arr=new Array(0) -var ecs_producer_status_arr=new Array(0) -var ecs_jobs=new Array(0) -var ecs_job_status=new Array(0) +//Status variables, for parameters values fetched from ics +var ics1="", ics2="", ics3="", ics4="", ics_types="-", ics_producers="-"; +var ics_producer_arr=new Array(0) +var ics_producer_type_arr=new Array(0) +var ics_producer_jobs_arr=new Array(0) +var ics_producer_status_arr=new Array(0) +var ics_jobs=new Array(0) +var ics_job_status=new Array(0) //Status variables, for parameters values fetched from prodstub var ps2="", ps3="", ps4="", ps_types="-", ps_producers="-"; @@ -209,7 +209,7 @@ var getCtr=0 var refreshCount_pol=-1 -var refreshCount_ecs=-1 +var refreshCount_ics=-1 var refreshCount_cr=-1 @@ -429,84 +429,84 @@ function fetchAllMetrics_pol() { }, 500) } -function fetchAllMetrics_ecs() { +function fetchAllMetrics_ics() { - console.log("Fetching enrichment metrics - timer:" + refreshCount_ecs) + console.log("Fetching information metrics - timer:" + refreshCount_ics) - if (refreshCount_ecs < 0) { - refreshCount_ecs = -1 + if (refreshCount_ics < 0) { + refreshCount_ics = -1 return } else { - refreshCount_ecs = refreshCount_ecs - 1 + refreshCount_ics = refreshCount_ics - 1 } setTimeout(() => { - if (checkFunctionFlag("ecs_stat")) { - getSimCtr(LOCALHOST+ECS_PORT+"/status", 0, function(data, index) { + if (checkFunctionFlag("ics_stat")) { + getSimCtr(LOCALHOST+ICS_PORT+"/status", 0, function(data, index) { try { var jd=JSON.parse(data); - ecs1=jd["status"] - ecs2=""+jd["no_of_producers"] - ecs3=""+jd["no_of_types"] - ecs4=""+jd["no_of_jobs"] + ics1=jd["status"] + ics2=""+jd["no_of_producers"] + ics3=""+jd["no_of_types"] + ics4=""+jd["no_of_jobs"] } catch (err) { - ecs1="error response" - ecs2="error response" - ecs3="error response" - ecs4="error response" + ics1="error response" + ics2="error response" + ics3="error response" + ics4="error response" } }); - clearFlag("ecs_stat") + clearFlag("ics_stat") } - if (checkFunctionFlag("ecs_types")) { - getSimCtr(LOCALHOST+ECS_PORT+"/ei-producer/v1/eitypes", 0, function(data, index) { - var tmp_ecs_types="-" + if (checkFunctionFlag("ics_types")) { + getSimCtr(LOCALHOST+ICS_PORT+"/ei-producer/v1/eitypes", 0, function(data, index) { + var tmp_ics_types="-" try { var jd=JSON.parse(data); for(var i=0;i" + "" + ""+ //2 sec auto refresh - "Enrichment coordinator service and producer stub"+ + "information coordinator service and producer stub"+ "" + "" + "" @@ -810,50 +810,50 @@ app.get("/mon2",function(req, res){ } else { htmlStr=htmlStr+"

Set query param '?summary' to false to only show full statistics

" } - if (ecs_job_status.length > 10) { + if (ics_job_status.length > 10) { htmlStr=htmlStr+"
Avoid running the server for large number of producers and/or jobs
" } htmlStr=htmlStr+"
" + - "

Enrichment Coordinator Service

" + + "

Information Coordinator Service

" + "" + - "Status:..........." + formatDataRow(ecs1) + "
" + - "Producers:........" + formatDataRow(ecs2) + "
" + - "Types:............" + formatDataRow(ecs3) + "
" + - "Jobs:............." + formatDataRow(ecs4) + "
" + + "Status:..........." + formatDataRow(ics1) + "
" + + "Producers:........" + formatDataRow(ics2) + "
" + + "Types:............" + formatDataRow(ics3) + "
" + + "Jobs:............." + formatDataRow(ics4) + "
" + "
" if (summary == "false") { htmlStr=htmlStr+ "

Details

" + "" + - "Producer ids:....." + formatDataRow(ecs_producers) + "
" + - "Type ids:........." + formatDataRow(ecs_types) + "
" + + "Producer ids:....." + formatDataRow(ics_producers) + "
" + + "Type ids:........." + formatDataRow(ics_types) + "
" + "
"; - for(var i=0;i" + var s = "Producer types...." + formatDataRow(ics_producer_type_arr[i]) + "
" htmlStr=htmlStr+s } } htmlStr=htmlStr+"
"; - for(i=0;i" + s = "Producer jobs....." + formatDataRow(ics_producer_jobs_arr[i]) + "
" htmlStr=htmlStr+s } } htmlStr=htmlStr+"
"; - for(i=0;i" htmlStr=htmlStr+s } } htmlStr=htmlStr+"
"; - for(i=0;i" htmlStr=htmlStr+s @@ -1025,5 +1025,5 @@ var httpPort=9999; httpServer.listen(httpPort); console.log("Simulator monitor listening (http) at "+httpPort); console.log("Open the web page on localhost:9999/mon to view the policy statistics page.") -console.log("Open the web page on localhost:9999/mon2 to view the enrichment statistics page.") +console.log("Open the web page on localhost:9999/mon2 to view the information statistics page.") console.log("Open the web page on localhost:9999/mon3 to view CR DB in json.") \ No newline at end of file