protected int compareExecutions(Aggregate one, Aggregate two) { if (one.getMeasurements() < two.getMeasurements()) { return descending ? 1 : -1; } else if (two.getMeasurements() < one.getMeasurements()) { return descending ? -1 : 1; } else { return 0; } }
public long getMeasurements() { return aggregate.getMeasurements(); }
private void writeMeasurements(StringBuffer aBuffer, Aggregate aPoint, int depth) { aBuffer.append(aPoint.getMeasurements()); aBuffer.append("<br />"); if (aPoint.hasChilds()) { Map childs = aPoint.getChilds(); int currentDepth = depth + 1; for (Iterator iterator = childs.values().iterator(); iterator.hasNext();) { Aggregate child = (Aggregate) iterator.next(); writeMeasurements(aBuffer, child, currentDepth); } } }
private void writeMeasurements(StringBuffer aBuffer, Aggregate aPoint, int depth) { aBuffer.append(aPoint.getMeasurements()); aBuffer.append("<br />"); if (aPoint.hasChilds()) { Map childs = aPoint.getChilds(); int currentDepth = depth + 1; for (Iterator iterator = childs.values().iterator(); iterator.hasNext();) { Aggregate child = (Aggregate) iterator.next(); writeMeasurements(aBuffer, child, currentDepth); } } }
public Object getAttribute(String string) throws AttributeNotFoundException, MBeanException, ReflectionException { if ("measurements".equals(string)) { return new Long(aggregate.getMeasurements()); } else if ("total".equals(string)) { return new Double(aggregate.getTotal()); } else if ("min".equals(string)) { return new Double(aggregate.getMin()); } else if ("max".equals(string)) { return new Double(aggregate.getMax()); } else if ("average".equals(string)) { return new Double(aggregate.getAverage()); } else { throw new AttributeNotFoundException(string); } }
public Object getAttribute(String string) throws AttributeNotFoundException, MBeanException, ReflectionException { if ("measurements".equals(string)) { return new Long(aggregate.getMeasurements()); } else if ("total".equals(string)) { return new Double(aggregate.getTotal()); } else if ("min".equals(string)) { return new Double(aggregate.getMin()); } else if ("max".equals(string)) { return new Double(aggregate.getMax()); } else if ("average".equals(string)) { return new Double(aggregate.getAverage()); } else { throw new AttributeNotFoundException(string); } }
private void writeMeasurements(StringBuffer aBuffer, Aggregate aPoint, int depth) { if (depth > 0) { aBuffer.append("<div class=\"childmeasurement\" >"); } else { aBuffer.append("<div class=\"parentmeasurement\" >"); } aBuffer.append(numberFormatter.format(aPoint.getMeasurements())); if (aPoint.hasChilds()) { Map childs = aPoint.getChilds(); int currentDepth = depth + 1; for (Iterator iterator = childs.values().iterator(); iterator.hasNext();) { Aggregate child = (Aggregate) iterator.next(); writeMeasurements(aBuffer, child, currentDepth); } } aBuffer.append("</div>"); }
public String convertValueToText(Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { if (value != null && value instanceof AggregationNode) { Aggregate aggregate = (Aggregate) ((AggregationNode) value).getUserObject(); return aggregate.getName() + " [" + aggregate.getMeasurements() + "]"; } return ""; }
protected void writeMeasurements(Aggregate aPoint) throws IOException { response.write("<div class=\"parentmeasurement\" >"); response.write(numberFormatter.format(aPoint.getMeasurements())); response.write("</div>"); }
public void render(Map points) { for (Iterator iterator = points.values().iterator(); iterator.hasNext();) { Aggregate aggregate = (Aggregate) iterator.next(); try { data.put(new CompositeDataSupport( tabularType.getRowType(), new String[]{"name", "measurements", "average", "min", "max", "total", "objectname"}, new Object[]{ aggregate.getName(), new Long(aggregate.getMeasurements()), new Double(aggregate.getAverage()), new Double(aggregate.getMin()), new Double(aggregate.getMax()), new Double(aggregate.getTotal()), calculateObjectName(measurementDomain, aggregate) })); } catch (Exception e) { throw new EtmException(e); } } } });
public void render(Map points) { String key = "SoapAction ASoapRequest"; assertTrue(points.containsKey(key)); Aggregate aggregate = (Aggregate) points.get(key); assertEquals(1, aggregate.getMeasurements()); assertEquals(15d, aggregate.getMin(), 0); } });
public void render(Map points) { String key = "POST request /test/testrequest"; assertTrue(points.containsKey(key)); Aggregate aggregate = (Aggregate) points.get(key); assertEquals(1, aggregate.getMeasurements()); assertEquals(15d, aggregate.getMin(), 0); } });
public int countExecutions(Map points) { int counter = 0; Collection col = points.values(); for (Iterator iterator = col.iterator(); iterator.hasNext();) { Aggregate aggregate = (Aggregate) iterator.next(); counter += aggregate.getMeasurements(); if (aggregate.hasChilds()) { counter += countExecutions(aggregate.getChilds()); } } return counter; } }
public void addLine(int nestingLevel, Aggregate aAggregate) { nameColumn.addEntry(new NestedEntry(nestingLevel, aAggregate.getName())); numberColumn.addEntry(new RightAlignedEntry(String.valueOf(aAggregate.getMeasurements()))); avgColumn.addEntry(new RightAlignedEntry(timeFormatter.format(aAggregate.getAverage()))); minColumn.addEntry(new RightAlignedEntry(timeFormatter.format(aAggregate.getMin()))); maxColumn.addEntry(new RightAlignedEntry(timeFormatter.format(aAggregate.getMax()))); totalColumn.addEntry(new RightAlignedEntry(timeFormatter.format(aAggregate.getTotal()))); }
public void addLine(int nestingLevel, Aggregate aAggregate) { nameColumn.addEntry(new NestedEntry(nestingLevel, aAggregate.getName())); numberColumn.addEntry(new RightAlignedEntry(String.valueOf(aAggregate.getMeasurements()))); avgColumn.addEntry(new RightAlignedEntry(timeFormatter.format(aAggregate.getAverage()))); minColumn.addEntry(new RightAlignedEntry(timeFormatter.format(aAggregate.getMin()))); maxColumn.addEntry(new RightAlignedEntry(timeFormatter.format(aAggregate.getMax()))); totalColumn.addEntry(new RightAlignedEntry(timeFormatter.format(aAggregate.getTotal()))); }
public void render(Map points) { assertNotNull(points); assertTrue(points.size() == pointSize); assertEquals(expectedExecutions, new TestHelper().countExecutions(points)); for (Iterator iterator = points.keySet().iterator(); iterator.hasNext();) { String s = (String) iterator.next(); Aggregate renderAggregate = (Aggregate) points.get(s); Aggregate actualAggregate = (Aggregate) aggregates.get(s); assertNotNull(actualAggregate); assertEquals(actualAggregate.getName(), renderAggregate.getName()); assertEquals(actualAggregate.getMeasurements(), renderAggregate.getMeasurements()); assertEquals(actualAggregate.getTotal(), renderAggregate.getTotal(), 0.00001); assertEquals(actualAggregate.getMin(), renderAggregate.getMin(), 0.00001); assertEquals(actualAggregate.getMax(), renderAggregate.getMax(), 0.00001); } } });
public void render(Map points) { assertNotNull(points); assertTrue(points.size() == 1); assertEquals(2, new TestHelper().countExecutions(points)); Aggregate aggregate = (Aggregate) points.get("test"); assertNotNull(aggregate); assertEquals("test", aggregate.getName()); assertEquals(2, aggregate.getMeasurements()); assertEquals(point.getTransactionTime() + point2.getTransactionTime(), aggregate.getTotal(), 0.000001); assertEquals(point2.getTransactionTime(), aggregate.getMin(), 0.000001); assertEquals(point.getTransactionTime(), aggregate.getMax(), 0.000001); }
public void render(Map points) { assertNotNull(points); assertEquals(1, points.size()); assertEquals(1, new TestHelper().countExecutions(points)); Aggregate aggregate = (Aggregate) points.get("test"); assertNotNull(aggregate); assertEquals("test", aggregate.getName()); assertEquals(1, aggregate.getMeasurements()); assertEquals(point.getTransactionTime(), aggregate.getTotal(), 0.000001); assertEquals(point.getTransactionTime(), aggregate.getMin(), 0.000001); assertEquals(point.getTransactionTime(), aggregate.getMax(), 0.000001); } });
public void render(Map points) { assertEquals(expectedExecutions, new TestHelper().countExecutions(points)); assertNotNull(points); assertTrue(points.size() == 1); Aggregate aggregate = (Aggregate) points.get(testPointGroup1); assertNotNull(aggregate); assertEquals(testPointGroup1, aggregate.getName()); assertEquals(group1.getMeasurements(), aggregate.getMeasurements()); assertEquals(group1.getTotal(), aggregate.getTotal(), 0.0001); assertEquals(group1.getMin(), aggregate.getMin(), 0.0001); assertEquals(group1.getMax(), aggregate.getMax(), 0.0001); } });
public void render(Map points) { assertNotNull(points); assertTrue(points.size() == 2); assertEquals(4, new TestHelper().countExecutions(points)); Aggregate aggregate = (Aggregate) points.get("test"); assertNotNull(aggregate); assertEquals("test", aggregate.getName()); assertEquals(2, aggregate.getMeasurements()); assertEquals(pointOne.getTransactionTime() + pointOne2.getTransactionTime(), aggregate.getTotal(), 0.000001); assertEquals(pointOne2.getTransactionTime(), aggregate.getMin(), 0.000001); assertEquals(pointOne.getTransactionTime(), aggregate.getMax(), 0.000001); Aggregate aggregate2 = (Aggregate) points.get("test2"); assertNotNull(aggregate2); assertEquals("test2", aggregate2.getName()); assertEquals(2, aggregate2.getMeasurements()); assertEquals(pointTwo.getTransactionTime() + pointTwo2.getTransactionTime(), aggregate2.getTotal(), 0.000001); assertEquals(pointTwo2.getTransactionTime(), aggregate2.getMin(), 0.000001); assertEquals(pointTwo.getTransactionTime(), aggregate2.getMax(), 0.000001); } });