+ var htmlStr = "<!DOCTYPE html>" +
+ "<html>" +
+ "<head>" +
+ "<meta http-equiv=\"refresh\" content=\"2\">"+ //2 sec auto refresh
+ "<title>Enrichment coordinator service and producer stub</title>"+
+ "</head>" +
+ "<body>" +
+ "<font size=\"-3\" face=\"summary\">"
+ if (summary == "false") {
+ htmlStr=htmlStr+"<p>Set query param '?summary' to true to only show summary statistics</p>"
+ } else {
+ htmlStr=htmlStr+"<p>Set query param '?summary' to false to only show full statistics</p>"
+ }
+ htmlStr=htmlStr+"</font>" +
+ "<h3>Enrichment Coordinator Service</h3>" +
+ "<font face=\"monospace\">" +
+ "Status:..........." + formatDataRow(ecs1) + "<br>" +
+ "Producers:........" + formatDataRow(ecs2) + "<br>" +
+ "Types:............" + formatDataRow(ecs3) + "<br>" +
+ "Jobs:............." + formatDataRow(ecs4) + "<br>" +
+ "</font>"
+ if (summary == "false") {
+ htmlStr=htmlStr+
+ "<h4>Details</h4>" +
+ "<font face=\"monospace\">" +
+ "Producer ids:....." + formatDataRow(ecs_producers) + "<br>" +
+ "Type ids:........." + formatDataRow(ecs_types) + "<br>" +
+ "<br>";
+ for(var i=0;i<ecs_producer_type_arr.length;i++) {
+ var tmp=ecs_producer_type_arr[i]
+ if (tmp != undefined) {
+ var s = "Producer types...." + formatDataRow(ecs_producer_type_arr[i]) + "<br>"
+ htmlStr=htmlStr+s
+ }
+ }
+ htmlStr=htmlStr+"<br>";
+ for(var i=0;i<ecs_producer_jobs_arr.length;i++) {
+ var tmp=ecs_producer_jobs_arr[i]
+ if (tmp != undefined) {
+ var s = "Producer jobs....." + formatDataRow(ecs_producer_jobs_arr[i]) + "<br>"
+ htmlStr=htmlStr+s
+ }
+ }
+ htmlStr=htmlStr+"<br>";
+ for(var i=0;i<ecs_producer_status_arr.length;i++) {
+ var tmp=ecs_producer_status_arr[i]
+ if (tmp != undefined) {
+ var s = "Producer status..." + formatDataRow(ecs_producer_status_arr[i]) + "<br>"
+ htmlStr=htmlStr+s
+ }
+ }
+ htmlStr=htmlStr+"<br>"+"<br>" +
+ "</font>"
+ }
+ htmlStr=htmlStr+
+ "<h3>Producer stub</h3>" +
+ "<font face=\"monospace\">" +
+ "Producers:........" + formatDataRow(ps2) + "<br>" +
+ "Types:............" + formatDataRow(ps3) + "<br>" +
+ "Jobs:............." + formatDataRow(ps4) + "<br>" +
+ "</font>"
+ if (summary == "false") {
+ htmlStr=htmlStr+
+ "<h4>Details</h4>" +
+ "<font face=\"monospace\">" +
+ "Producer ids:....." + formatDataRow(ps_producers) + "<br>" +
+ "Type ids:........." + formatDataRow(ps_types) + "<br>" +
+ "<br>";
+ for(var i=0;i<ps_producer_type_arr.length;i++) {
+ var tmp=ps_producer_type_arr[i]
+ if (tmp != undefined) {
+ var s = "Producer types...." + formatDataRow(ps_producer_type_arr[i]) + "<br>"
+ htmlStr=htmlStr+s
+ }
+ }
+ htmlStr=htmlStr+"<br>";
+ for(var i=0;i<ps_producer_jobs_arr.length;i++) {
+ var tmp=ps_producer_jobs_arr[i]
+ if (tmp != undefined) {
+ var s = "Producer jobs....." + formatDataRow(ps_producer_jobs_arr[i]) + "<br>"
+ htmlStr=htmlStr+s
+ }
+ }
+ htmlStr=htmlStr+"<br>";
+ for(var i=0;i<ps_producer_delivery_arr.length;i++) {
+ var tmp=ps_producer_delivery_arr[i]
+ if (tmp != undefined) {
+ var s = "Producer delivery." + formatDataRow(ps_producer_delivery_arr[i]) + "<br>"
+ htmlStr=htmlStr+s
+ }
+ }
+ }
+ htmlStr=htmlStr+
+ "</font>" +
+ "</body>" +
+ "</html>";
+ res.send(htmlStr);
+})
+
+// Monitor for policy management
+app.get("/mon",function(req, res){
+
+ console.log("Creating policy metrics page " + refreshCount_pol)
+
+ if (refreshCount_pol < 0) {
+ refreshCount_pol=5
+ fetchAllMetrics_pol()
+ }
+ refreshCount_pol=5
+
+ var bn=req.query.basename
+
+ if (bn == undefined) {
+ getCtr=0
+ return res.redirect('/mon?basename=ricsim');
+ } else {
+ ricbasename=bn
+ }
+
+ //Build web page