/** * Returns an array of datasource names defined in RRD. * * @return Array of datasource names. * @throws java.io.IOException Thrown in case of I/O error. */ public String[] getDsNames() throws IOException { int n = datasources.length; String[] dsNames = new String[n]; for (int i = 0; i < n; i++) { dsNames[i] = datasources[i].getName(); } return dsNames; }
/** * <p>Returns an array of datasource names defined in RRD.</p> * * @return Array of datasource names. * @throws IOException Thrown in case of I/O error. */ public String[] getDsNames() throws IOException { int n = datasources.length; String[] dsNames = new String[n]; for (int i = 0; i < n; i++) { dsNames[i] = datasources[i].getName(); } return dsNames; }
/** * Checks presence of a specific datasource. * * @param dsName Datasource name to check * @return <code>true</code> if datasource is present in this RRD, <code>false</code> otherwise * @throws java.io.IOException Thrown in case of I/O error. */ public boolean containsDs(String dsName) throws IOException { for (Datasource datasource : datasources) { if (datasource.getName().equals(dsName)) { return true; } } return false; }
/** * Checks presence of a specific datasource. * * @param dsName Datasource name to check * @return <code>true</code> if datasource is present in this RRD, <code>false</code> otherwise * @throws IOException Thrown in case of I/O error. */ public boolean containsDs(String dsName) throws IOException { for (Datasource datasource : datasources) { if (datasource.getName().equals(dsName)) { return true; } } return false; }
/** * Returns internal index number for the given datasource name. * * @param dsName Data source name. * @return Internal index of the given data source name in this RRD. * @throws java.io.IOException Thrown in case of I/O error. */ public int getDsIndex(String dsName) throws IOException { for (int i = 0; i < datasources.length; i++) { if (datasources[i].getName().equals(dsName)) { return i; } } throw new IllegalArgumentException("Unknown datasource name: " + dsName); }
/** * Returns internal index number for the given datasource name. * * @param dsName Data source name. * @return Internal index of the given data source name in this RRD. * @throws IOException Thrown in case of I/O error. */ public int getDsIndex(String dsName) throws IOException { for (int i = 0; i < datasources.length; i++) { if (datasources[i].getName().equals(dsName)) { return i; } } throw new IllegalArgumentException("Unknown datasource name: " + dsName); }
static int getMatchingDatasourceIndex(RrdDb rrd1, int dsIndex, RrdDb rrd2) throws IOException { String dsName = rrd1.getDatasource(dsIndex).getName(); try { return rrd2.getDsIndex(dsName); } catch (IllegalArgumentException e) { return -1; } }
final void archive(Datasource datasource, double value, long numUpdates) throws IOException { int dsIndex = getDsIndex(datasource.getName()); for (Archive archive : archives) { archive.archive(dsIndex, value, numUpdates); } }
static int getMatchingDatasourceIndex(RrdDb rrd1, int dsIndex, RrdDb rrd2) throws IOException { String dsName = rrd1.getDatasource(dsIndex).getName(); try { return rrd2.getDsIndex(dsName); } catch (IllegalArgumentException e) { return -1; } }
final void archive(Datasource datasource, double value, double lastValue, long numUpdates) throws IOException { int dsIndex = getDsIndex(datasource.getName()); for (Archive archive : archives) { if (ConsolFun.AVERAGE.equals(archive.getConsolFun())) { archive.archive(dsIndex, value, numUpdates); } else { archive.archive(dsIndex, lastValue, numUpdates); } } }
String currentDsName = datasource.getName(); if (!currentDsName.endsWith(DsDef.FORCE_ZEROS_FOR_NANS_SUFFIX)) { datasource.setDsName(currentDsName + DsDef.FORCE_ZEROS_FOR_NANS_SUFFIX);
String currentDsName = datasource.getName(); if (!currentDsName.endsWith(DsDef.FORCE_ZEROS_FOR_NANS_SUFFIX)) { datasource.setDsName(currentDsName + DsDef.FORCE_ZEROS_FOR_NANS_SUFFIX);
for(int i = 0; i < dsCount; i++) { Datasource srcDs = rrdSource.getDatasource(i); String dsName = srcDs.getName(); Datasource dstDS = rrdDest.getDatasource(dsName); if(dstDS != null) { for(int k = 0; k < dsCount; k++) { Datasource srcDs = rrdSource.getDatasource(k); String dsName = srcDs.getName(); try { int j = rrdDest.getDsIndex(dsName);
Datasource ds = rrd.getDatasource(dsIndex); values = new Object[]{ ds.getName(), ds.getType(), "" + ds.getHeartbeat(),
DsDef dsDef = new DsDef(datasource.getName(), datasource.getType(), datasource.getHeartbeat(), datasource.getMinValue(), datasource.getMaxValue());
DsDef dsDef = new DsDef(datasource.getName(), datasource.getType(), datasource.getHeartbeat(), datasource.getMinValue(), datasource.getMaxValue());
Archive arc = rrdDb.getArchive(arcIndex); Robin robin = arc.getRobin(dsIndex); dsName = ds.getName(); t1 = arc.getStartTime(); t2 = arc.getEndTime();