/** * Adds the given value to the set of values on which the average is based. * <p> * If the sum of all values is greater as <tt>Double.MAX_VALUE / 2</tt> or the count of all values is greater as * <tt>Long.Max_VALUE / 2</tt>, the average is resetted. * * @param value to value to add to the average */ public void addValue(double value) { addValues(1, value); }
protected void tryCommit(boolean cascade) { if (stmt == null) { return; } if (batchBacklog > 0) { try { Watch w = Watch.start(); stmt.executeBatch(); avarage.addValues(batchBacklog, w.elapsedMillis()); batchBacklog = 0; } catch (SQLException e) { if (cascade) { context.safeClose(); } throw Exceptions.handle() .to(OMA.LOG) .error(e) .withSystemErrorMessage("An error occured while batch executing a statement: %s (%s)") .handle(); } } }