/** * Count the thrown exception and put the stack trace in the details portion of the key. * This will allow the stack trace to be viewed in the JAMon web application. */ protected void trackException(MonKey key, Throwable ex) { String stackTrace = "stackTrace=" + Misc.getExceptionTrace(ex); key.setDetails(stackTrace); // Specific exception counter. Example: java.lang.RuntimeException MonitorFactory.add(new MonKeyImp(ex.getClass().getName(), stackTrace, "Exception"), 1); // General exception counter which is a total for all exceptions thrown MonitorFactory.add(new MonKeyImp(MonitorFactory.EXCEPTIONS_LABEL, stackTrace, "Exception"), 1); }
private SQLDeArgMon appendDetails(String stackTrace) { if ("".equalsIgnoreCase(stackTrace)) return this; Monitor[] monArr=monitors.getMonitors(); StringBuilder sb=new StringBuilder(); sb.append(monArr[0].getMonKey().getDetails()).append("\n").append(stackTrace); for (int i=0;i<monArr.length;i++) { Monitor mon=monArr[i]; mon.getMonKey().setDetails(sb.toString()); } return this; }
private void changeDetails() { int len=(timeMons==null) ? 0 : timeMons.length; for (int i=0;i<len;i++) timeMons[i].getMonKey().setDetails( getDetailLabel()); }
/** Note this creates 2 exception monitors and the more specific one is returned */ @Override public Monitor addException(Monitor mon, Throwable throwable) { String stackTtrace = new StringBuffer("stackTrace=") .append(Misc.getExceptionTrace(throwable)) .toString(); if (mon!=null) { MonKey key = mon.getMonKey(); key.setDetails(stackTtrace); } MonitorFactory.add(new MonKeyImp(MonitorFactory.EXCEPTIONS_LABEL, stackTtrace, "Exception"), 1); return MonitorFactory.add(new MonKeyImp(throwable.getClass().getName(), stackTtrace, "Exception"), 1); }
/** * Count the thrown exception and put the stack trace in the details portion of the key. * This will allow the stack trace to be viewed in the JAMon web application. */ protected void trackException(MonKey key, Throwable ex) { String stackTrace = "stackTrace=" + Misc.getExceptionTrace(ex); key.setDetails(stackTrace); // Specific exception counter. Example: java.lang.RuntimeException MonitorFactory.add(new MonKeyImp(ex.getClass().getName(), stackTrace, "Exception"), 1); // General exception counter which is a total for all exceptions thrown MonitorFactory.add(new MonKeyImp(MonitorFactory.EXCEPTIONS_LABEL, stackTrace, "Exception"), 1); }
/** * Count the thrown exception and put the stack trace in the details portion of the key. * This will allow the stack trace to be viewed in the JAMon web application. */ protected void trackException(MonKey key, Throwable ex) { String stackTrace = "stackTrace=" + Misc.getExceptionTrace(ex); key.setDetails(stackTrace); // Specific exception counter. Example: java.lang.RuntimeException MonitorFactory.add(new MonKeyImp(ex.getClass().getName(), stackTrace, "Exception"), 1); // General exception counter which is a total for all exceptions thrown MonitorFactory.add(new MonKeyImp(MonitorFactory.EXCEPTIONS_LABEL, stackTrace, "Exception"), 1); }
@Override public void stop(Monitor mon, Throwable throwable) { mon.stop(); put(throwable); // note the following 'get' always succeeds because of the above 'put' mon.getMonKey().setDetails(get(throwable)); }
@Override public void stop(Monitor mon, Throwable throwable) { mon.stop(); put(throwable); // note the following 'get' always succeeds because of the above 'put' mon.getMonKey().setDetails(get(throwable)); }