diff --git a/src/main/java/org/ecocean/MetricsBot.java b/src/main/java/org/ecocean/MetricsBot.java index ff70bc0315..3f9bcc3ac5 100644 --- a/src/main/java/org/ecocean/MetricsBot.java +++ b/src/main/java/org/ecocean/MetricsBot.java @@ -84,6 +84,7 @@ private static void startCollector(final String context) { //throws IOException //DO METRICS WORK HERE public void run() { + try { ++count; if (new java.io.File("/tmp/WB_METRICSBOT_SHUTDOWN").exists()) { System.out.println("INFO: MetricsBot.startCollection(" + context + ") shutting down due to file signal"); @@ -92,6 +93,11 @@ public void run() { } refreshMetrics(context); + } + catch(Exception e) { + System.out.println("Hit exception in startCollectot.run() of MetricsBot!"); + e.printStackTrace(); + } } diff --git a/src/main/webapp/appadmin/refreshMetrics.jsp b/src/main/webapp/appadmin/refreshMetrics.jsp new file mode 100644 index 0000000000..2151c736fa --- /dev/null +++ b/src/main/webapp/appadmin/refreshMetrics.jsp @@ -0,0 +1,75 @@ + +<%@ page contentType="text/html; charset=utf-8" language="java" import="org.joda.time.LocalDateTime,org.ecocean.servlet.importer.*, +org.joda.time.format.DateTimeFormatter, +org.joda.time.format.ISODateTimeFormat,java.net.*, +org.ecocean.grid.*, +org.ecocean.media.MediaAsset,org.ecocean.servlet.importer.ImportTask, +java.io.*,java.util.*, java.io.FileInputStream, +java.text.SimpleDateFormat, +java.util.Date,org.ecocean.ia.*, +org.ecocean.identity.IBEISIA,org.ecocean.social.*,org.ecocean.ia.Task, +org.apache.poi.ss.usermodel.DateUtil, +java.io.File, java.io.FileNotFoundException, org.ecocean.*,org.ecocean.servlet.*,javax.jdo.*, java.lang.StringBuffer, java.util.Vector, +java.util.Iterator, java.lang.NumberFormatException"%> + + + +<% + +String context="context0"; +context=ServletUtilities.getContext(request); + +Shepherd myShepherd=new Shepherd(context); + + + +%> + + + +Fix Standard Children + + + + + + + +
    +<% + +myShepherd.beginDBTransaction(); + +int numFixes=0; +int numOrphanAssets=0; +int numDatalessAssets=0; +int numDatasFixed=0; +int numAssetsFixed=0; +int numAssetsWithoutStore=0; + +boolean committing=true; + + +try{ + + MetricsBot.refreshMetrics(context); + + +} +catch(Exception e){ + e.printStackTrace(); +} +finally{ + myShepherd.rollbackDBTransaction(); + myShepherd.closeDBTransaction(); + +} + +%> + +
+ + + +