java.lang.Object
org.rrd4j.graph.RrdGraphInfo

public class RrdGraphInfoextends Object
Class to represent successfully created Rrd4j graph. Objects of this class are created by method RrdGraph.getRrdGraphInfo().
  • Field Details

    • filename

      String filename
      Path of the backing RRD file, or '-' when the graph was never written to disk.
    • width

      int width
      Rendered image size in pixels, as requested from the graph definition.
    • height

      int height
      Rendered image size in pixels, as requested from the graph definition.
    • bytesSource

      java.util.function.Supplier<byte[]> bytesSource
      Supplies the rendered image bytes; throws IllegalStateException when unavailable.
    • bytesCount

      java.util.function.Supplier<Integer> bytesCount
      Supplies the rendered image size in bytes; throws IllegalStateException when unavailable.
    • imgInfo

      String imgInfo
      The image information comment carried through from the graph definition.
    • printLines

      private final List<String> printLines
      The lines produced by the print option
    • meta

      private RrdGraphMeta meta
      The graph's metadata.
  • Constructor Details

    • RrdGraphInfo

      RrdGraphInfo()
      Prevent instantiation
  • Method Details

    • setMeta

      void setMeta(RrdGraphMeta meta)
      Attaches the plot geometry and series for this render.
      Parameters:
      meta - the metadata, never null
    • getMeta

      public RrdGraphMeta getMeta()
      The plot geometry and series, for a client that wants to invert a cursor position into a time and a value. Absent when the graph was not rendered through this package.
      Returns:
      the metadata, or null when none was recorded
    • addPrintLine

      void addPrintLine(String printLine)
      Record a formatted PRINT line, in the order added.
      Parameters:
      printLine - the already formatted line to record in the order added
    • getFilename

      public String getFilename()
      Returns filename of the graph
      Returns:
      filename of the graph. '-' denotes in-memory graph (no file created)
    • getWidth

      public int getWidth()
      Returns total graph width
      Returns:
      total graph width
    • getHeight

      public int getHeight()
      Returns total graph height
      Returns:
      total graph height
    • getBytes

      public byte[] getBytes()
      Returns the rendered image bytes.
      Returns:
      the graph image bytes, in the format the graph definition selected
      Throws:
      IllegalStateException - if the images bytes are unavailable or can't be read
    • getPrintLines

      public String[] getPrintLines()
      Returns PRINT lines requested by RrdGraphDef.print(String, org.rrd4j.ConsolFun, String) method.
      Returns:
      An array of formatted PRINT lines
    • getImgInfo

      public String getImgInfo()
      Returns image information requested by RrdGraphDef.setImageInfo(String) method
      Returns:
      the formatted image information comment, or null when the graph definition set no imageInfo template
    • getByteCount

      public int getByteCount()
      Returns the number of bytes in the graph file
      Returns:
      Length of the graph file
      Throws:
      IllegalStateException - if the images bytes are unavailable
    • dump

      public String dump()
      Dumps complete graph information. Useful for debugging purposes.
      Returns:
      String containing complete graph information