Package org.rrd4j.graph

Examples of org.rrd4j.graph.RrdGraphDef


  public void generateGraph(long startTimestamp, long stopTimestamp, BufferedImage bufferedImage) throws Exception
  {
    File file = FileTools.newAkteraFile("/var/aktera/jvm-memory/" + name + ".rrd");
    String fileName = file.getAbsolutePath();

    RrdGraphDef gDef = new RrdGraphDef();

    gDef.setWidth(1024);
    gDef.setHeight(768);
    gDef.setFilename(fileName + ".png");
    gDef.setLazy(false);
    gDef.setStartTime(startTimestamp);
    gDef.setEndTime(stopTimestamp);
    gDef.setTitle(name);
    gDef.setVerticalLabel("Memory");
    gDef.datasource("Init", fileName, "Init", AVERAGE);
    gDef.datasource("Used", fileName, "Used", AVERAGE);
    gDef.datasource("Committed", fileName, "Committed", AVERAGE);
    gDef.datasource("Max", fileName, "Max", AVERAGE);

    gDef.line("Init", Color.GREEN, "Init memory");
    gDef.area("Max", Color.RED, "Max memory\n");
    gDef.area("Committed", Color.gray, "Committed memory");
    gDef.area("Used", Color.GREEN, "Used memory");

    gDef.gprint("Used", MAX, "used-max = %.3f%s");
    gDef.gprint("Committed", MAX, "committed-max = %.3f%S\\r");
    gDef.gprint("Max", MAX, "max = %.3f%S");
    gDef.gprint("Used", AVERAGE, "used-avg = %.3f%S\\r");
    gDef.setImageInfo("<img src='%s' width='%d' height = '%d'>");
    gDef.setPoolUsed(false);
    gDef.setImageFormat("png");
    gDef.setAltAutoscaleMax(true);
    gDef.setAntiAliasing(true);

    // create graph finally
    RrdGraph graph = new RrdGraph(gDef);

    graph.render(bufferedImage.getGraphics());
View Full Code Here


        @Override
        public void run() {
            try {
                // generate PNG diagram
                RrdGraphDef gDef = new RrdGraphDef();
                gDef.setFilename("-");
                gDef.setWidth(800);
                gDef.setHeight(600);
                gDef.setStartTime(start / 1000);
                gDef.setEndTime(System.currentTimeMillis() / 1000);
                gDef.setTitle("KiWiLoader Performance");
                gDef.setVerticalLabel("number/sec");
                gDef.setAntiAliasing(true);


                gDef.datasource("triples", statFile.toString(), "triples", ConsolFun.AVERAGE);

                gDef.line("triples", Color.BLUE, "Triples Written", 3F);


                gDef.setImageFormat("png");
                gDef.gprint("triples", ConsolFun.AVERAGE, "average triples/sec: %,.0f\\l");

                RrdGraph graph = new RrdGraph(gDef);
                BufferedImage img = new BufferedImage(900,750, BufferedImage.TYPE_INT_RGB);
                graph.render(img.getGraphics());
View Full Code Here

  }

  @Override
  public BufferedImage createChart(String service, String theme, Date startTime, Date endTime, int height, int width,
      String items, String groups) throws ItemNotFoundException {
    RrdGraphDef graphDef = new RrdGraphDef();

    long period = (startTime.getTime() - endTime.getTime()) / 1000;
   
    graphDef.setWidth(width);
    graphDef.setHeight(height);
    graphDef.setAntiAliasing(true);
    graphDef.setImageFormat("PNG");
    graphDef.setStartTime(period);
    graphDef.setTextAntiAliasing(true);
    graphDef.setLargeFont(new Font("SansSerif", Font.PLAIN, 15));
    graphDef.setSmallFont(new Font("SansSerif", Font.PLAIN, 11));
   
    int seriesCounter = 0;

    // Loop through all the items
    if (items != null) {
View Full Code Here

TOP

Related Classes of org.rrd4j.graph.RrdGraphDef

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.