java.lang.Object
org.rrd4j.graph.RrdGraphInfo
Class to represent successfully created Rrd4j graph. Objects of this class are created by method
RrdGraph.getRrdGraphInfo().Field Summary
FieldsModifier and TypeFieldDescription(package private) java.util.function.Supplier<Integer> Supplies the rendered image size in bytes; throws IllegalStateException when unavailable.(package private) java.util.function.Supplier<byte[]> Supplies the rendered image bytes; throws IllegalStateException when unavailable.(package private) StringPath of the backing RRD file, or '-' when the graph was never written to disk.(package private) intRendered image size in pixels, as requested from the graph definition.(package private) StringThe image information comment carried through from the graph definition.private RrdGraphMetaThe graph's metadata.The lines produced by the print option(package private) intRendered image size in pixels, as requested from the graph definition.Constructor Summary
ConstructorsMethod Summary
Public MethodsModifier and TypeMethodDescription(package private) voidaddPrintLine(String printLine) Record a formatted PRINT line, in the order added.dump()Dumps complete graph information.intReturns the number of bytes in the graph filebyte[]getBytes()Returns the rendered image bytes.Returns filename of the graphintReturns total graph heightReturns image information requested byRrdGraphDef.setImageInfo(String)methodgetMeta()The plot geometry and series, for a client that wants to invert a cursor position into a time and a value.String[]Returns PRINT lines requested byRrdGraphDef.print(String, org.rrd4j.ConsolFun, String)method.intgetWidth()Returns total graph width(package private) voidsetMeta(RrdGraphMeta meta) Attaches the plot geometry and series for this render.
Field Details
filename
String filenamePath of the backing RRD file, or '-' when the graph was never written to disk.width
int widthRendered image size in pixels, as requested from the graph definition.height
int heightRendered image size in pixels, as requested from the graph definition.bytesSource
java.util.function.Supplier<byte[]> bytesSourceSupplies the rendered image bytes; throws IllegalStateException when unavailable.bytesCount
java.util.function.Supplier<Integer> bytesCountSupplies the rendered image size in bytes; throws IllegalStateException when unavailable.imgInfo
String imgInfoThe image information comment carried through from the graph definition.printLines
meta
The graph's metadata.
Constructor Details
RrdGraphInfo
RrdGraphInfo()Prevent instantiation
Method Details
setMeta
Attaches the plot geometry and series for this render.- Parameters:
meta- the metadata, never null
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
Record a formatted PRINT line, in the order added.- Parameters:
printLine- the already formatted line to record in the order added
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
Returns PRINT lines requested byRrdGraphDef.print(String, org.rrd4j.ConsolFun, String)method.- Returns:
- An array of formatted PRINT lines
getImgInfo
Returns image information requested byRrdGraphDef.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
Dumps complete graph information. Useful for debugging purposes.- Returns:
- String containing complete graph information