/** * Creates a new SimpleTreeModelAggregator with a RootAggregator as * backing aggregator instance. * * @param aName The name of the root node. * @see RootAggregator */ public SimpleTreeModelAggregator(String aName) { this(aName, new RootAggregator()); }
public void init(EtmMonitorContext ctx) { super.init(ctx); context = ctx; if (persistenceBackend == null) { persistenceBackend = new FileSystemPersistenceBackend(); } if (backendProperties != null) { PropertySupport.setProperties(persistenceBackend, backendProperties); } }
public void stop() { PersistentEtmState state = new PersistentEtmState(); state.setStartTime(context.getEtmMonitor().getMetaData().getStartTime()); state.setLastResetTime(context.getEtmMonitor().getMetaData().getLastResetTime()); state.setAggregates(aggregates); persistenceBackend.store(state); super.stop(); }
public void start() { super.start(); PersistentEtmState state = persistenceBackend.load(); if (state != null) { aggregates = state.getAggregates(); context.fireEvent(new AggregationStateLoadedEvent(state, this)); } }
public void add(EtmPoint point) { // shortcut for parent == null; if (point.getParent() == null) { ExecutionAggregate aggregate = getAggregate(point.getName()); aggregate.addTransaction(point); return; } // TODO check alternative strategy to improve performance // find tree root node LinkedList path = new LinkedList(); path.add(point); EtmPoint rootNode = point.getParent(); while (rootNode != null) { path.addFirst(rootNode); rootNode = rootNode.getParent(); } rootNode = (EtmPoint) path.removeFirst(); ExecutionAggregate aggregate = getAggregate(rootNode.getName()); aggregate.appendPath(path); }
public void stop() { PersistentEtmState state = new PersistentEtmState(); state.setStartTime(context.getEtmMonitor().getMetaData().getStartTime()); state.setLastResetTime(context.getEtmMonitor().getMetaData().getLastResetTime()); state.setAggregates(aggregates); persistenceBackend.store(state); super.stop(); }
public void start() { super.start(); PersistentEtmState state = persistenceBackend.load(); if (state != null) { aggregates = state.getAggregates(); context.fireEvent(new AggregationStateLoadedEvent(state, this)); } }
public void add(EtmPoint point) { // shortcut for parent == null; if (point.getParent() == null) { ExecutionAggregate aggregate = getAggregate(point.getName()); aggregate.addTransaction(point); return; } // TODO check alternative strategy to improve performance // find tree root node LinkedList path = new LinkedList(); path.add(point); EtmPoint rootNode = point.getParent(); while (rootNode != null) { path.addFirst(rootNode); rootNode = rootNode.getParent(); } rootNode = (EtmPoint) path.removeFirst(); ExecutionAggregate aggregate = getAggregate(rootNode.getName()); aggregate.appendPath(path); }
protected Aggregator getDefaultAggregator() { return new BufferedThresholdAggregator(new RootAggregator()); }
public void init(EtmMonitorContext ctx) { super.init(ctx); context = ctx; if (persistenceBackend == null) { persistenceBackend = new FileSystemPersistenceBackend(); } if (backendProperties != null) { PropertySupport.setProperties(persistenceBackend, backendProperties); } }
protected Aggregator getDefaultAggregator() { return new BufferedThresholdAggregator(new RootAggregator()); }
protected Aggregator getDefaultAggregator() { return new RootAggregator(); } }
protected void setUp() throws Exception { super.setUp(); monitor = new FlatMonitor(EtmMonitorFactory.bestAvailableTimer(), new BufferedTimedAggregator(new RootAggregator())); monitor.start(); }
protected void setUp() throws Exception { super.setUp(); monitor = new FlatMonitor(EtmMonitorFactory.bestAvailableTimer(), new BufferedThresholdAggregator(new RootAggregator())); monitor.start(); }
/** * Tests the log aggregator filtering mechanism. If filtering works * the overall implementation works. */ public void testWithoutFilter() { EtmMonitor monitor = new FlatMonitor(); monitor.start(); TestLogAggregator aggregator = new TestLogAggregator(new RootAggregator()); aggregator.add(createCollectedPoint(monitor, "Action Foo")); aggregator.add(createCollectedPoint(monitor, "Action Bar")); aggregator.add(createCollectedPoint(monitor, "AnotherPoint")); aggregator.add(createCollectedPoint(monitor, "ClassName")); aggregator.add(createCollectedPoint(monitor, "Action Bar")); assertEquals(5, aggregator.points.size()); }
/** * Tests the log aggregator filtering mechanism. If filtering works * the overall implementation works. */ public void testFilter() { EtmMonitor monitor = new FlatMonitor(); monitor.start(); TestLogAggregator aggregator = new TestLogAggregator(new RootAggregator()); aggregator.setFilterPattern("Action.+;ClassName;"); aggregator.add(createCollectedPoint(monitor, "Action Foo")); aggregator.add(createCollectedPoint(monitor, "Action Bar")); aggregator.add(createCollectedPoint(monitor, "AnotherPoint")); aggregator.add(createCollectedPoint(monitor, "ClassName")); aggregator.add(createCollectedPoint(monitor, "Action Bar")); assertEquals(4, aggregator.points.size()); }
EtmMonitor monitor = new NestedMonitor(new NotifyingAggregator(new RootAggregator())); try { path.delete();