@Test public void testGraph() throws Exception { if (m_strategy != null) { String rrdtoolBin = System.getProperty("install.rrdtool.bin"); if (rrdtoolBin != null) { File rrdtoolFile = new File(rrdtoolBin); if (!rrdtoolFile.exists()) { System.err.println(rrdtoolBin + " does not exist"); return; } } else { System.err.println("System property 'install.rrdtool.bin' not set: skipping test"); return; } long end = System.currentTimeMillis(); long start = end - (24 * 60 * 60 * 1000); String[] command = new String[] { rrdtoolBin, "graph", "-", "--start=" + start, "--end=" + end, "COMMENT:test" }; m_strategy.createGraph(StringUtils.arrayToDelimitedString(command, " "), (new File(rrdtoolBin)).getParentFile()); } }
public InputStream createGraph(String command, File workDir) throws IOException, RrdException { byte[] byteArray = createGraphAsByteArray(command, workDir); return new ByteArrayInputStream(byteArray); }
JniRrdStrategy implements RrdStrategy<JniRrdStrategy.CreateCommand ,StringBuffer> { public InputStream createGraph(String command, File workDir) throws IOException, RrdException { byte[] byteArray = createGraphAsByteArray(command, workDir); return new ByteArrayInputStream(byteArray); } }
JniRrdStrategy implements RrdStrategy<JniRrdStrategy.CreateCommand ,StringBuffer> { public InputStream createGraph(String command, File workDir) throws IOException, RrdException { byte[] byteArray = createGraphAsByteArray(command, workDir); return new ByteArrayInputStream(byteArray); } JniRrdStrategy(); }
JniRrdStrategy implements RrdStrategy<JniRrdStrategy.CreateCommand ,StringBuffer> { public InputStream createGraph(String command, File workDir) throws IOException, RrdException { byte[] byteArray = createGraphAsByteArray(command, workDir); return new ByteArrayInputStream(byteArray); } JniRrdStrategy(); Properties getConfigurationProperties(); void setConfigurationProperties(Properties configurationParameters); void closeFile(StringBuffer rrd); CreateCommand createDefinition(String creator, String directory, String rrdName, int step, List<RrdDataSource> dataSources, List<String> rraList); void createFile(CreateCommand createCommand, Map<String, String> attributeMappings); StringBuffer openFile(String fileName); void updateFile(StringBuffer rrd, String owner, String data); Double fetchLastValue(String rrdFile, String ds, int interval); Double fetchLastValue(String rrdFile, String ds, String consolidationFunction, int interval); Double fetchLastValueInRange(String rrdFile, String ds, int interval, int range); InputStream createGraph(String command, File workDir); String getStats(); int getGraphLeftOffset(); int getGraphRightOffset(); int getGraphTopOffsetWithText(); String getDefaultFileExtension(); RrdGraphDetails createGraphReturnDetails(String command, File workDir); void promoteEnqueuedFiles(Collection<String> rrdFiles); }
JniRrdStrategy implements RrdStrategy<JniRrdStrategy.CreateCommand ,StringBuffer> { public InputStream createGraph(String command, File workDir) throws IOException, RrdException { byte[] byteArray = createGraphAsByteArray(command, workDir); return new ByteArrayInputStream(byteArray); } JniRrdStrategy(); Properties getConfigurationProperties(); void setConfigurationProperties(Properties configurationParameters); void closeFile(StringBuffer rrd); CreateCommand createDefinition(String creator, String directory, String rrdName, int step, List<RrdDataSource> dataSources, List<String> rraList); void createFile(CreateCommand createCommand, Map<String, String> attributeMappings); StringBuffer openFile(String fileName); void updateFile(StringBuffer rrd, String owner, String data); Double fetchLastValue(String rrdFile, String ds, int interval); Double fetchLastValue(String rrdFile, String ds, String consolidationFunction, int interval); Double fetchLastValueInRange(String rrdFile, String ds, int interval, int range); InputStream createGraph(String command, File workDir); String getStats(); int getGraphLeftOffset(); int getGraphRightOffset(); int getGraphTopOffsetWithText(); String getDefaultFileExtension(); RrdGraphDetails createGraphReturnDetails(String command, File workDir); void promoteEnqueuedFiles(Collection<String> rrdFiles);  }