/** * Sets datasource min value to a new value * * @param sourcePath Path to exisiting RRD file (will be updated) * @param datasourceName Name of the datasource in the specified RRD file * @param newMinValue New min value for the datasource * @param filterArchivedValues set to <code>true</code> if archived values less than * <code>newMinValue</code> should be set to NaN; set to false, otherwise. * @throws IOException Thrown in case of I/O error */ public static void setDsMinValue(String sourcePath, String datasourceName, double newMinValue, boolean filterArchivedValues) throws IOException { RrdDb rrd = new RrdDb(sourcePath); try { Datasource ds = rrd.getDatasource(datasourceName); ds.setMinValue(newMinValue, filterArchivedValues); } finally { rrd.close(); } }
/** * Sets datasource min value to a new value * * @param sourcePath Path to existing RRD file (will be updated) * @param datasourceName Name of the datasource in the specified RRD file * @param newMinValue New min value for the datasource * @param filterArchivedValues set to <code>true</code> if archived values less than * <code>newMinValue</code> should be set to NaN; set to false, otherwise. * @throws java.io.IOException Thrown in case of I/O error */ public static void setDsMinValue(String sourcePath, String datasourceName, double newMinValue, boolean filterArchivedValues) throws IOException { try (RrdDb rrd = RrdDb.getBuilder().setPath(sourcePath).build()) { Datasource ds = rrd.getDatasource(datasourceName); ds.setMinValue(newMinValue, filterArchivedValues); } }