private static long extractLastTimestamp(RrdDb aDb) { try { return aDb.getLastUpdateTime(); } catch (IOException e) { throw new EtmException(e); } }
long lastUpdateTime = rrdDb.getLastUpdateTime(); if (now - rrdDb.getLastUpdateTime() >= minimumUpdateTimeDelta) { updateSample(now, val); } else {
/** * Return the date of the last update of the rrd backend * * @return The date */ public Date getLastUpdate() { Date lastUpdate = null; RrdDb rrdDb = null; try { rrdDb = factory.getRrd(getPath()); lastUpdate = Util.getDate(rrdDb.getLastUpdateTime()); } catch (Exception e) { throw new RuntimeException("Unable to get last update date for " + p.getQualifiedName(), e); } finally { if(rrdDb != null) factory.releaseRrd(rrdDb); } return lastUpdate; }
println("== Last update time was: " + rrdDb.getLastUpdateTime()); println("== Last info was: " + rrdDb.getInfo());