public void nestedMethod() { EtmPoint point = etmMonitor.createPoint("BusinessService:nestedMethod"); try { Thread.sleep((long) (15d * Math.random())); } catch (InterruptedException e) { // ignored } finally { point.collect(); } } }
@Override public void filter(ContainerRequestContext requestContext) throws IOException { EtmPoint point = etmMonitor.createPoint("HTTP " + request.getMethod() + " request " + getPath()); request.setAttribute(JETM_JAXRS_POINT, point); }
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { String soapAction = ((HttpServletRequest) servletRequest).getHeader("SoapAction"); if (soapAction == null || soapAction.length() == 0) { super.doFilter(servletRequest, servletResponse, filterChain); } else { EtmPoint point = etmMonitor.createPoint("SoapAction " + soapAction); try { filterChain.doFilter(servletRequest, servletResponse); } finally { point.collect(); } } }
public void someMethod() { EtmPoint point = etmMonitor.createPoint("BusinessService:someMethod"); try { Thread.sleep((long) (10d * Math.random())); nestedMethod(); } catch (InterruptedException e) { // ignored } finally { point.collect(); } }
public void download(final Collection<? extends FileRequest> requests) { final EtmPoint point = MONITOR.createPoint(getClass().getName() + ": download(Collection)"); try { // If there's nothing to download... if (requests.isEmpty()) return; for (final FileRequest request : requests) processor.queueDownload(request); processor.download(); } finally { point.collect(); } }
public void upload(final Collection<? extends FileRequest> requests) { final EtmPoint point = MONITOR.createPoint(getClass().getName() + ": upload(Collection)"); try { if (requests.isEmpty()) return; for (final FileRequest request : requests) processor.queueUpload(request, ignoreChmodErrors, permissions); processor.upload(); } finally { point.collect(); } }
@AroundInvoke public Object measure(InvocationContext ctx) throws Exception { String targetMethod = calculateMethodName(ctx); EtmPoint point = EtmManager.getEtmMonitor().createPoint(targetMethod); try { return ctx.proceed(); } catch (Exception e) { point.alterName(targetMethod + "[ " + e.getClass().getSimpleName() + "]"); throw e; } finally { point.collect(); } }
public Object invoke(ProceedingJoinPoint jp) throws Throwable { EtmPoint etmPoint = etmMonitor.createPoint(calculateName(jp)); try { return jp.proceed(); } catch (Throwable t) { alterNamePostException(etmPoint, t); throw t; } finally { etmPoint.collect(); } }
@Override public void execute(FacesContext context) throws FacesException { EtmPoint requestPoint = EtmManager.getEtmMonitor().createPoint(getDefaultRequestName(context)); context.getAttributes().put(EtmJsfPlugin.ROOT_ETM_POINT, requestPoint); delegate.execute(context); }
@Override public UIViewRoot createView(FacesContext aFacesContext, String s) { EtmPoint point = EtmManager.getEtmMonitor().createPoint("Create view " + s); try { return delegate.createView(aFacesContext, s); } finally { point.collect(); } }
@Override public UIViewRoot restoreView(FacesContext aFacesContext, String s) { EtmPoint point = EtmManager.getEtmMonitor().createPoint("Restore view " + s); try { return delegate.restoreView(aFacesContext, s); } finally { point.collect(); } }
public Object monitor(EtmJoinPoint aJoinPoint, String aJoinPointName) throws Throwable { EtmPoint etmPoint = etmMonitor.createPoint(aJoinPointName); try { return aJoinPoint.proceed(); } catch (Throwable t) { aJoinPoint.alterNamePostException(etmPoint, t); throw t; } finally { etmPoint.collect(); } }
@Override public void writeState(FacesContext aFacesContext) throws IOException { EtmPoint point = EtmManager.getEtmMonitor().createPoint("Write state"); try { delegate.writeState(aFacesContext); } finally { point.collect(); } } }
protected EtmPoint createCollectedPoint(EtmMonitor aMonitor, String aSymbolicName) { EtmPoint point = aMonitor.createPoint(aSymbolicName); point.collect(); return point; }
@Override public Connection getConnection() { final EtmPoint point = MONITOR.createPoint(getClass().getName() + ": getConnection()"); try { return pool.getConnection(product.getUsername(), product.getPassword(), product.getServerAddress()); } finally { point.collect(); } }
@Override public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException { EtmPoint point = EtmManager.getEtmMonitor().createPoint(pointName); try { validator.validate(context, component, value); } finally { point.collect(); } }
@Override public Connection getConnection() { final EtmPoint point = MONITOR.createPoint(getClass().getName() + ": getConnection()"); try { return pool.getConnection(product.getUsername(), product.getKeySalt(), product.getPrivateKey(), product.getServerAddress()); } finally { point.collect(); } }
@Override public void renderView(FacesContext aFacesContext, UIViewRoot aUIViewRoot) throws IOException, FacesException { EtmPoint point = EtmManager.getEtmMonitor().createPoint("Render view " + aUIViewRoot.getViewId()); try { delegate.renderView(aFacesContext, aUIViewRoot); } finally { point.collect(); } }
private void doNested(EtmPoint[] points, int i) throws Exception { EtmPoint point = monitor.createPoint("test" + i); Thread.sleep(2 * i); points[i - 1] = point; i--; if (i != 0) { doNested(points, i); } point.collect(); }
public void beforePhase(PhaseEvent event) { FacesContext facesContext = event.getFacesContext(); EtmPoint oldPoint = (EtmPoint) facesContext.getAttributes().get(CURRENT_PHASE_POINT); if (oldPoint != null) { // do some cleanup, should never happen actually oldPoint.alterName(oldPoint.getName() + " - uncollected"); oldPoint.collect(); } String symbolicName = "JSF Phase " + event.getPhaseId().getOrdinal() + " - " + String.valueOf(event.getPhaseId()); EtmPoint point = EtmManager.getEtmMonitor().createPoint(symbolicName); facesContext.getAttributes().put(CURRENT_PHASE_POINT, point); }