@Test public void testMemoryLeakage() { long memoryBaseline = 0; SummaryStatistics stats = new SummaryStatistics(); int numRuns = 25; for (int r = 0; r < numRuns; r++) { if (r == 1 || r == (numRuns - 1)) { memoryBaseline = MemoryAssess.getMemoryUse(); stats.addValue(memoryBaseline); //System.out.println("Memory before run "+(r+1)+": " + memoryBaseline / 1024 + " KB"); } for (int t = 0; t < 1000; t++) { graph.addVertex(); graph.tx().rollback(); TitanTransaction tx = graph.newTransaction(); tx.addVertex(); tx.rollback(); } if (r == 1 || r == (numRuns - 1)) { memoryBaseline = MemoryAssess.getMemoryUse(); stats.addValue(memoryBaseline); //System.out.println("Memory after run " + (r + 1) + ": " + memoryBaseline / 1024 + " KB"); } clopen(); } System.out.println("Average: " + stats.getMean() + " Std. Dev: " + stats.getStandardDeviation()); assertTrue(stats.getStandardDeviation() < stats.getMin()); }
@Test public void testMemoryLeakage() { long memoryBaseline = 0; SummaryStatistics stats = new SummaryStatistics(); int numRuns = 25; for (int r = 0; r < numRuns; r++) { if (r == 1 || r == (numRuns - 1)) { memoryBaseline = MemoryAssess.getMemoryUse(); stats.addValue(memoryBaseline); //System.out.println("Memory before run "+(r+1)+": " + memoryBaseline / 1024 + " KB"); } for (int t = 0; t < 1000; t++) { graph.addVertex(); graph.tx().rollback(); JanusGraphTransaction tx = graph.newTransaction(); tx.addVertex(); tx.rollback(); } if (r == 1 || r == (numRuns - 1)) { memoryBaseline = MemoryAssess.getMemoryUse(); stats.addValue(memoryBaseline); //System.out.println("Memory after run " + (r + 1) + ": " + memoryBaseline / 1024 + " KB"); } clopen(); } System.out.println("Average: " + stats.getMean() + " Std. Dev: " + stats.getStandardDeviation()); assertTrue(stats.getStandardDeviation() < stats.getMin()); }
/** * {@inheritDoc}. This version returns the minimum over all the aggregated * data. * * @see StatisticalSummary#getMin() */ public double getMin() { synchronized (statistics) { return statistics.getMin(); } }
/** * {@inheritDoc} */ @Override public synchronized double getMin() { return super.getMin(); }
/** * @see org.apache.commons.math.stat.descriptive.SummaryStatistics#getMin() */ public synchronized double getMin() { return super.getMin(); }
public double getMinInDegree() { // return minIn; return inStats.getMin(); }
/** * {@inheritDoc}. This version returns the minimum over all the aggregated * data. * * @see StatisticalSummary#getMin() */ public double getMin() { synchronized (statistics) { return statistics.getMin(); } }
/** * {@inheritDoc} */ @Override public synchronized double getMin() { return super.getMin(); }
public double getMin() { return statistics.getMin(); }
/** * Generates a text report displaying summary statistics from values that * have been added. * @return String with line feeds displaying statistics * @since 1.2 */ @Override public String toString() { StringBuilder outBuffer = new StringBuilder(); String endl = "\n"; outBuffer.append("SummaryStatistics:").append(endl); outBuffer.append("n: ").append(getN()).append(endl); outBuffer.append("min: ").append(getMin()).append(endl); outBuffer.append("max: ").append(getMax()).append(endl); outBuffer.append("mean: ").append(getMean()).append(endl); outBuffer.append("geometric mean: ").append(getGeometricMean()) .append(endl); outBuffer.append("variance: ").append(getVariance()).append(endl); outBuffer.append("sum of squares: ").append(getSumsq()).append(endl); outBuffer.append("standard deviation: ").append(getStandardDeviation()) .append(endl); outBuffer.append("sum of logs: ").append(getSumOfLogs()).append(endl); return outBuffer.toString(); }
/** * Generates a text report displaying * summary statistics from values that * have been added. * @return String with line feeds displaying statistics * @since 1.2 */ public String toString() { StringBuffer outBuffer = new StringBuffer(); outBuffer.append("SummaryStatistics:\n"); outBuffer.append("n: " + getN() + "\n"); outBuffer.append("min: " + getMin() + "\n"); outBuffer.append("max: " + getMax() + "\n"); outBuffer.append("mean: " + getMean() + "\n"); outBuffer.append("geometric mean: " + getGeometricMean() + "\n"); outBuffer.append("variance: " + getVariance() + "\n"); outBuffer.append("sum of squares: " + getSumsq() + "\n"); outBuffer.append("standard deviation: " + getStandardDeviation() + "\n"); outBuffer.append("sum of logs: " + getSumOfLogs() + "\n"); return outBuffer.toString(); }
public String toString() { if (cachedStringRepresentation == null) { try { cachedStringRepresentation = "Min: " + (int) stats.getMin() + ", mean: " + (int) stats.getMean() + ", max: " + (int) stats.getMax() + ", stddev: " + (int) stats.getStandardDeviation() + ", score: " + (int) getScore(); } catch (IOException e) { throw new RuntimeException(e); } } return cachedStringRepresentation; } }
public GaugeMetricValue build() { return new GaugeMetricValue(valueRange, stats.getMin(), stats.getMax(), stats.getN(), Double.isNaN(stats.getSum()) ? 0.0 : stats.getSum(), Double.isNaN(stats.getSumsq()) ? 0.0 : stats.getSumsq(), accum.getSparseHistogram()); } }
private void writeDistribution(Language language, File outputDir, Genome genome) throws IOException { String fileName = language.getName() + " " + "Min: " + (int) genome.getFitness().stats.getMin() + " " + "Mean: " + (int) genome.getFitness().stats.getMean() + " " + "Max: " + (int) genome.getFitness().stats.getMax() + " " + "SD: " + (int) genome.getFitness().stats.getStandardDeviation() + " " + "Score: " + (int) genome.getFitness().getScore(); File output = new File(outputDir, fileName); FileWriter writer = new FileWriter(output); writer.write(genome.getFitness().toString() + "\n" + genome.toString()); writer.close(); }
/** * Return a {@link StatisticalSummaryValues} instance reporting current * statistics. * * @return Current values of statistics */ public StatisticalSummary getSummary() { return new StatisticalSummaryValues(getMean(), getVariance(), getN(), getMax(), getMin(), getSum()); }
/** * Return a {@link StatisticalSummaryValues} instance reporting current * statistics. * @return Current values of statistics */ public StatisticalSummary getSummary() { return new StatisticalSummaryValues(getMean(), getVariance(), getN(), getMax(), getMin(), getSum()); }
/** * Return a {@link StatisticalSummaryValues} instance reporting current * statistics. * @return Current values of statistics */ public StatisticalSummary getSummary() { return new StatisticalSummaryValues(getMean(), getVariance(), getN(), getMax(), getMin(), getSum()); }
/** * Returns hash code based on values of statistics * @return hash code */ @Override public int hashCode() { int result = 31 + MathUtils.hash(getGeometricMean()); result = result * 31 + MathUtils.hash(getGeometricMean()); result = result * 31 + MathUtils.hash(getMax()); result = result * 31 + MathUtils.hash(getMean()); result = result * 31 + MathUtils.hash(getMin()); result = result * 31 + MathUtils.hash(getN()); result = result * 31 + MathUtils.hash(getSum()); result = result * 31 + MathUtils.hash(getSumsq()); result = result * 31 + MathUtils.hash(getVariance()); return result; }
/** * Returns hash code based on values of statistics * @return hash code */ @Override public int hashCode() { int result = 31 + MathUtils.hash(getGeometricMean()); result = result * 31 + MathUtils.hash(getGeometricMean()); result = result * 31 + MathUtils.hash(getMax()); result = result * 31 + MathUtils.hash(getMean()); result = result * 31 + MathUtils.hash(getMin()); result = result * 31 + MathUtils.hash(getN()); result = result * 31 + MathUtils.hash(getSum()); result = result * 31 + MathUtils.hash(getSumsq()); result = result * 31 + MathUtils.hash(getVariance()); return result; }
/** * Returns hash code based on values of statistics * * @return hash code */ public int hashCode() { int result = 31 + MathUtils.hash(getGeometricMean()); result = result * 31 + MathUtils.hash(getGeometricMean()); result = result * 31 + MathUtils.hash(getMax()); result = result * 31 + MathUtils.hash(getMean()); result = result * 31 + MathUtils.hash(getMin()); result = result * 31 + MathUtils.hash(getN()); result = result * 31 + MathUtils.hash(getSum()); result = result * 31 + MathUtils.hash(getSumsq()); result = result * 31 + MathUtils.hash(getVariance()); return result; }