private void doFlush(EtmPoint[] aCurrent, int aLength) { synchronized (delegate) { for (int i = 0; i < aLength; i++) { delegate.add(aCurrent[i]); } } }
public void flush() { int length; EtmPoint[] current; synchronized (this) { length = currentPos; current = buffer; buffer = new EtmPoint[current.length]; currentPos = 0; } synchronized (delegate) { for (int i = 0; i < length; i++) { delegate.add(current[i]); } } } }
public void add(EtmPoint point) { points.add(point); delegate.add(point); }
public void add(EtmPoint point) { delegate.add(point); if (filter == null || filter.matches(point)) { logMeasurement(point); } }
private void doFlush(EtmPoint[] aCurrent, int aLength) { synchronized (delegate) { Iterator it = nonCollectable.iterator(); while(it.hasNext()) { EtmPoint point = (EtmPoint) it.next(); if (point.isCollectable()) { delegate.add(point); it.remove(); } } for (int i = 0; i < aLength; i++) { EtmPoint point = aCurrent[i]; if (point.isCollectable()) { delegate.add(point); } else { nonCollectable.add(point); } } context.fireEvent(new AggregationFinishedEvent(this)); } }
public void flush() { int length; EtmPoint[] current; synchronized (this) { length = currentPos; current = buffer; buffer = new EtmPoint[current.length]; currentPos = 0; } synchronized (delegate) { Iterator it = nonCollectable.iterator(); while(it.hasNext()) { EtmPoint point = (EtmPoint) it.next(); if (point.isCollectable()) { delegate.add(point); it.remove(); } } for (int i = 0; i < length; i++) { EtmPoint point = current[i]; if (point.isCollectable()) { delegate.add(point); } else { nonCollectable.add(point); } } ctx.fireEvent(new AggregationFinishedEvent(this)); } }
public void add(EtmPoint point) { delegate.add(point); if (!rootOnly || point.getParent() == null) { ctx.fireEvent(new CollectEvent(this, point)); } }
public void add(EtmPoint point) { delegate.add(point); if (!rootOnly || point.getParent() == null) { ctx.fireEvent(new CollectEvent(this, point)); } }
public void add(EtmPoint point) { LinkedList path = new LinkedList(); path.add(point.getName()); EtmPoint parent = point.getParent(); while (parent != null) { path.addFirst(parent.getName()); parent = parent.getParent(); } DefaultMutableTreeNode node = (DefaultMutableTreeNode) getRoot(); while (!path.isEmpty()) { String currentString = (String) path.removeFirst(); Enumeration childs = node.children(); DefaultMutableTreeNode currentChild = null; while (currentChild == null && childs.hasMoreElements()) { DefaultMutableTreeNode measurementNode = (DefaultMutableTreeNode) childs.nextElement(); Aggregate aggregate = (Aggregate) measurementNode.getUserObject(); if (aggregate.getName().equals(currentString)) { currentChild = measurementNode; } } if (currentChild == null) { currentChild = new DefaultMutableTreeNode(new ExecutionAggregate(currentString)); insertNodeInto(currentChild, node, getChildCount(currentChild)); } node = currentChild; } ((ExecutionAggregate) node.getUserObject()).addTransaction(point); nodeChanged(node); delegate.add(point); }
public final void visitPostCollect(MeasurementPoint measurementPoint) { if (!collecting || !started) { return; } if (measurementPoint == null) { return; } try { measurementPoint.setEndTime(timer.getCurrentTime()); doVisitPostCollect(measurementPoint); aggregator.add(measurementPoint); // catch all exceptions here // in order to avoid negative side effects for // our business logic } catch (Exception e) { log.warn("Caught exception within measurement code.", e); } }
public final void visitPostCollect(MeasurementPoint measurementPoint) { if (!collecting || !started) { return; } if (measurementPoint == null || measurementPoint.isCollected()) { return; } try { measurementPoint.setEndTime(timer.getCurrentTime()); doVisitPostCollect(measurementPoint); aggregator.add(measurementPoint); // catch all exceptions here // in order to avoid negative side effects for // our business logic } catch (Exception e) { LOG.warn("Caught exception within measurement code.", e); } }