Package net.i2p.router.web
Class SummaryListener
- java.lang.Object
-
- net.i2p.router.web.SummaryListener
-
- All Implemented Interfaces:
RateSummaryListener
public class SummaryListener extends Object implements RateSummaryListener
Creates and updates the in-memory or on-disk RRD database, and provides methods to generate graphs of the data- Since:
- 0.6.1.13
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static ConsolFunCF(package private) static DsTypeDSstatic intMAX_ROWS(package private) static intPERIODSstatic StringPROP_PERSISTENT(package private) static StringRRD_DIRnote that .jrb files are NOT compatible with .rrd files(package private) static StringRRD_PREFIX(package private) static StringRRD_SUFFIX
-
Constructor Summary
Constructors Constructor Description SummaryListener(Rate r)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(double totalValue, long eventCount, double totalEventTime, long period)(package private) static StringcreateName(I2PAppContext ctx, String wanted)JRobin can only deal with 20 character data source names, so we need to create a unique, munged version from the user/developer-visible name.booleanequals(Object obj)(package private) RrdBackendFactorygetBackendFactory()(package private) RrdDbgetData()(package private) StringgetEventName()(package private) StringgetName()RategetRate()(package private) intgetRows()inthashCode()(package private) longnow()voidrenderPng(OutputStream out)voidrenderPng(OutputStream out, int width, int height, boolean hideLegend, boolean hideGrid, boolean hideTitle, boolean showEvents, int periodCount, int end, boolean showCredit)Single graph.voidrenderPng(OutputStream out, int width, int height, boolean hideLegend, boolean hideGrid, boolean hideTitle, boolean showEvents, int periodCount, int end, boolean showCredit, SummaryListener lsnr2, String titleOverride)Single or two-data-source graph.booleanstartListening()voidstopListening()
-
-
-
Field Detail
-
PROP_PERSISTENT
public static final String PROP_PERSISTENT
- Since:
- public since 0.9.33, was package private
- See Also:
- Constant Field Values
-
RRD_DIR
static final String RRD_DIR
note that .jrb files are NOT compatible with .rrd files- See Also:
- Constant Field Values
-
RRD_PREFIX
static final String RRD_PREFIX
- See Also:
- Constant Field Values
-
RRD_SUFFIX
static final String RRD_SUFFIX
- See Also:
- Constant Field Values
-
CF
static final ConsolFun CF
-
DS
static final DsType DS
-
PERIODS
static final int PERIODS
- See Also:
- Constant Field Values
-
MAX_ROWS
public static final int MAX_ROWS
- Since:
- public since 0.9.33, was package private
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SummaryListener
public SummaryListener(Rate r)
-
-
Method Detail
-
add
public void add(double totalValue, long eventCount, double totalEventTime, long period)- Specified by:
addin interfaceRateSummaryListener- Parameters:
totalValue- sum of all event values in the most recent periodeventCount- how many events occurredtotalEventTime- how long the events were running forperiod- how long this period is
-
createName
static String createName(I2PAppContext ctx, String wanted)
JRobin can only deal with 20 character data source names, so we need to create a unique, munged version from the user/developer-visible name.
-
getRate
public Rate getRate()
-
startListening
public boolean startListening()
- Returns:
- success
-
stopListening
public void stopListening()
-
renderPng
public void renderPng(OutputStream out, int width, int height, boolean hideLegend, boolean hideGrid, boolean hideTitle, boolean showEvents, int periodCount, int end, boolean showCredit) throws IOException
Single graph.- Parameters:
end- number of periods before now- Throws:
IOException
-
renderPng
public void renderPng(OutputStream out, int width, int height, boolean hideLegend, boolean hideGrid, boolean hideTitle, boolean showEvents, int periodCount, int end, boolean showCredit, SummaryListener lsnr2, String titleOverride) throws IOException
Single or two-data-source graph.- Parameters:
lsnr2- 2nd data source to plot on same graph, or null. Not recommended for events.titleOverride- If non-null, overrides the title- Throws:
IOException- Since:
- 0.9.6
-
renderPng
public void renderPng(OutputStream out) throws IOException
- Throws:
IOException
-
getName
String getName()
-
getEventName
String getEventName()
-
getData
RrdDb getData()
-
now
long now()
-
getBackendFactory
RrdBackendFactory getBackendFactory()
- Since:
- 0.9.46
-
getRows
int getRows()
- Since:
- 0.8.7
-
-