Package net.i2p.router.web
Class StatSummarizer
- java.lang.Object
-
- net.i2p.router.web.StatSummarizer
-
public class StatSummarizer extends Object implements Runnable, ClientApp
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
Fields Modifier and Type Field Description static String
DEFAULT_DATABASES
-
Constructor Summary
Constructors Constructor Description StatSummarizer(RouterContext ctx)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description String
getDisplayName()
The display name of the ClientApp, used in user interfaces.List<SummaryListener>
getListeners()
List of SummaryListener instancesString
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)
static StatSummarizer
instance()
static StatSummarizer
instance(I2PAppContext ctx)
static boolean
isDisabled(I2PAppContext ctx)
Set<Rate>
parseSpecs(String specs)
boolean
renderPng(OutputStream out, String templateFilename)
Deprecated.unusedboolean
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) void
setDisabled()
Disable graph generation until restart See SummaryRenderer.render()(package private) static void
setDisabled(I2PAppContext ctx)
Disable graph generation until restart See SummaryRenderer.render()void
shutdown(String[] args)
Does nothing, we aren't trackedvoid
startup()
Does nothing, we aren't tracked
-
-
-
Field Detail
-
DEFAULT_DATABASES
public static final String DEFAULT_DATABASES
- Since:
- public since 0.9.33, was package private
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
StatSummarizer
public StatSummarizer(RouterContext ctx)
-
-
Method Detail
-
instance
public static StatSummarizer instance()
- Returns:
- null if disabled
-
instance
public static StatSummarizer instance(I2PAppContext ctx)
- Returns:
- null if disabled
- Since:
- 0.9.38
-
isDisabled
public static boolean isDisabled(I2PAppContext ctx)
- Since:
- 0.9.38
-
setDisabled
static void setDisabled(I2PAppContext ctx)
Disable graph generation until restart See SummaryRenderer.render()- Since:
- 0.9.6
-
setDisabled
void setDisabled()
Disable graph generation until restart See SummaryRenderer.render()- Since:
- 0.9.38
-
startup
public void startup()
Does nothing, we aren't tracked
-
shutdown
public void shutdown(String[] args)
Does nothing, we aren't tracked
-
getState
public ClientAppState getState()
Description copied from interface:ClientApp
The current state of the ClientApp.
-
getName
public String getName()
Description copied from interface:ClientApp
The generic name of the ClientApp, used for registration, e.g. "console". Do not translate.
-
getDisplayName
public String getDisplayName()
Description copied from interface:ClientApp
The display name of the ClientApp, used in user interfaces. The app must translate.- Specified by:
getDisplayName
in interfaceClientApp
- Returns:
- non-null
- Since:
- 0.9.38
-
getListeners
public List<SummaryListener> getListeners()
List of SummaryListener instances- Since:
- public since 0.9.33, was package private
-
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
-
-