net.i2p.router.web
Class StatSummarizer

java.lang.Object
  extended by net.i2p.router.web.StatSummarizer
All Implemented Interfaces:
Runnable

public class StatSummarizer
extends Object
implements Runnable

A thread started by RouterConsoleRunner that checks the configuration for stats to be tracked via jrobin, and adds or deletes RRDs as necessary. This also contains methods to generate xml or png image output. The rendering for graphs is in SummaryRenderer. To control memory, the number of simultaneous renderings is limited.

Since:
0.6.1.13

Field Summary
(package private) static String DEFAULT_DATABASES
           
 
Constructor Summary
StatSummarizer()
           
 
Method Summary
(package private)  List<SummaryListener> getListeners()
          list of SummaryListener instances
 boolean getXML(Rate rate, OutputStream out)
           
static StatSummarizer instance()
           
(package private) static boolean isDisabled()
           
(package private)  Set<Rate> parseSpecs(String specs)
           
 boolean renderPng(OutputStream out, String templateFilename)
          Deprecated. unused
 boolean renderPng(Rate rate, OutputStream out)
           
 boolean renderPng(Rate rate, OutputStream out, int width, int height, boolean hideLegend, boolean hideGrid, boolean hideTitle, boolean showEvents, int periodCount, int end, boolean showCredit)
          This does the single data graphs.
 boolean renderRatePng(OutputStream out, int width, int height, boolean hideLegend, boolean hideGrid, boolean hideTitle, boolean showEvents, int periodCount, int end, boolean showCredit)
          This does the two-data bandwidth graph only.
 void run()
           
(package private) static void setDisabled()
          Disable graph generation until restart See SummaryRenderer.render()
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_DATABASES

static final String DEFAULT_DATABASES
See Also:
Constant Field Values
Constructor Detail

StatSummarizer

public StatSummarizer()
Method Detail

instance

public static StatSummarizer instance()

run

public void run()
Specified by:
run in interface Runnable

isDisabled

static boolean isDisabled()
Since:
0.8.7

setDisabled

static void setDisabled()
Disable graph generation until restart See SummaryRenderer.render()

Since:
0.9.6

getListeners

List<SummaryListener> getListeners()
list of SummaryListener instances


renderPng

public boolean renderPng(Rate rate,
                         OutputStream out)
                  throws IOException
Throws:
IOException

renderPng

public boolean renderPng(Rate rate,
                         OutputStream out,
                         int width,
                         int height,
                         boolean hideLegend,
                         boolean hideGrid,
                         boolean hideTitle,
                         boolean showEvents,
                         int periodCount,
                         int end,
                         boolean showCredit)
                  throws IOException
This does the single data graphs. For the two-data bandwidth graph see renderRatePng(). Synchronized to conserve memory.

Parameters:
end - number of periods before now
Returns:
success
Throws:
IOException

renderPng

public boolean renderPng(OutputStream out,
                         String templateFilename)
                  throws IOException
Deprecated. unused

Throws:
IOException

getXML

public boolean getXML(Rate rate,
                      OutputStream out)
               throws IOException
Throws:
IOException

renderRatePng

public boolean renderRatePng(OutputStream out,
                             int width,
                             int height,
                             boolean hideLegend,
                             boolean hideGrid,
                             boolean hideTitle,
                             boolean showEvents,
                             int periodCount,
                             int end,
                             boolean showCredit)
                      throws IOException
This does the two-data bandwidth graph only. For all other graphs see renderPng() above. Synchronized to conserve memory.

Parameters:
end - number of periods before now
Returns:
success
Throws:
IOException

parseSpecs

Set<Rate> parseSpecs(String specs)
Parameters:
specs - statName.period,statName.period,statName.period
Returns:
list of Rate objects