public class GraphGenerator extends Object implements Runnable, ClientApp
| Modifier and Type | Field and Description |
|---|---|
static String | DEFAULT_DATABASES |
| Constructor and Description |
|---|
GraphGenerator(RouterContext ctx)GraphGenerator. |
| Modifier and Type | Method and Description |
|---|---|
int | countGraphs() |
String | getDisplayName()The display name of the ClientApp, used in user interfaces. |
List<GraphListener> | getListeners()List of GraphListener instances |
String | getName()The generic name of the ClientApp, used for registration,
e.g. |
ClientAppState | getState()The current state of the ClientApp. |
boolean | getXML(Rate rate,
OutputStream out)Export rate data as XML. |
static GraphGenerator | instance() |
static GraphGenerator | instance(I2PAppContext ctx) |
static boolean | isDisabled(I2PAppContext ctx) |
Set<Rate> | parseSpecs(String specs) |
boolean | renderCombinedGraph(OutputStream out,
int width,
int height,
boolean hideLegend,
boolean hideGrid,
boolean hideTitle,
boolean showEvents,
int periodCount,
int end,
boolean showCredit)Render the two-data bandwidth graph with the specified options. |
boolean | renderCombinedGraph(OutputStream out,
int width,
int height,
boolean hideLegend,
boolean hideGrid,
boolean hideTitle,
boolean showEvents,
int periodCount,
int end,
boolean showCredit,
boolean showRestarts)Render the two-data bandwidth graph with the specified options. |
boolean | renderGraph(Rate rate,
OutputStream out)Render a single-data graph with default dimensions and options. |
boolean | renderGraph(Rate rate,
OutputStream out,
int width,
int height,
boolean hideLegend,
boolean hideGrid,
boolean hideTitle,
boolean showEvents,
int periodCount,
int end,
boolean showCredit)Render a single-data graph with the specified options. |
boolean | renderGraph(Rate rate,
OutputStream out,
int width,
int height,
boolean hideLegend,
boolean hideGrid,
boolean hideTitle,
boolean showEvents,
int periodCount,
int end,
boolean showCredit,
boolean showRestarts)Render a single-data graph with the specified options. |
void | run()run. |
(package private) void | setDisabled()Disable graph generation until restart |
(package private) static void | setDisabled(I2PAppContext ctx)Disable graph generation until restart |
void | shutdown(String[] args)Does nothing, we aren't tracked |
void | startup()Does nothing, we aren't tracked |
void | stop()stop. |
public static final String DEFAULT_DATABASES
public GraphGenerator(RouterContext ctx)
public int countGraphs()
public String getDisplayName()
ClientAppgetDisplayName in interface ClientApppublic List<GraphListener> getListeners()
public String getName()
ClientApppublic ClientAppState getState()
ClientApppublic boolean getXML(Rate rate, OutputStream out) throws IOException
rate - the rate to exportout - the output stream to write the XML toIOException - if export failspublic static GraphGenerator instance()
public static GraphGenerator instance(I2PAppContext ctx)
public static boolean isDisabled(I2PAppContext ctx)
public Set<Rate> parseSpecs(String specs)
specs - statName.period,statName.period,statName.periodpublic boolean renderCombinedGraph(OutputStream out, int width, int height, boolean hideLegend, boolean hideGrid, boolean hideTitle, boolean showEvents, int periodCount, int end, boolean showCredit) throws IOException
out - the output stream to write the graph image towidth - image width in pixelsheight - image height in pixelshideLegend - if true, omit the legendhideGrid - if true, omit the grid lineshideTitle - if true, omit the titleshowEvents - if true, draw event markersperiodCount - number of time periods to display, or -1 for defaultend - number of periods before now to end atshowCredit - if true, show the I2P+ credit lineIOException - if rendering failspublic boolean renderCombinedGraph(OutputStream out, int width, int height, boolean hideLegend, boolean hideGrid, boolean hideTitle, boolean showEvents, int periodCount, int end, boolean showCredit, boolean showRestarts) throws IOException
out - the output stream to write towidth - image width in pixelsheight - image height in pixelshideLegend - if true, omit the legendhideGrid - if true, omit the grid lineshideTitle - if true, omit the titleshowEvents - if true, draw event markersperiodCount - number of time periods to display, or -1 for defaultend - number of periods before now to end atshowCredit - if true, show the I2P+ credit lineshowRestarts - if true, draw the vertical restart lines and "Router restarted" labelIOException - if rendering failspublic boolean renderGraph(Rate rate, OutputStream out) throws IOException
rate - the rate to graphout - the output stream to write the graph image toIOException - if rendering failspublic boolean renderGraph(Rate rate, OutputStream out, int width, int height, boolean hideLegend, boolean hideGrid, boolean hideTitle, boolean showEvents, int periodCount, int end, boolean showCredit) throws IOException
rate - the rate to graphout - the output stream to write the graph image towidth - image width in pixelsheight - image height in pixelshideLegend - if true, omit the legendhideGrid - if true, omit the grid lineshideTitle - if true, omit the titleshowEvents - if true, draw event markersperiodCount - number of time periods to display, or -1 for defaultend - number of periods before now to end atshowCredit - if true, show the I2P+ credit lineIOException - if rendering failspublic boolean renderGraph(Rate rate, OutputStream out, int width, int height, boolean hideLegend, boolean hideGrid, boolean hideTitle, boolean showEvents, int periodCount, int end, boolean showCredit, boolean showRestarts) throws IOException
rate - the rate to graphout - the output stream to write the graph image towidth - image width in pixelsheight - image height in pixelshideLegend - if true, omit the legendhideGrid - if true, omit the grid lineshideTitle - if true, omit the titleshowEvents - if true, draw event markersperiodCount - number of time periods to display, or -1 for defaultend - number of periods before now to end atshowCredit - if true, show the I2P+ credit lineshowRestarts - if true, draw the vertical restart lines and "Router restarted" labelIOException - if rendering failsvoid setDisabled()
static void setDisabled(I2PAppContext ctx)
public void shutdown(String[] args)
public void startup()
public void stop()