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 ConsolFun
CF
(package private) static DsType
DS
static int
MAX_ROWS
(package private) static int
PERIODS
static String
PROP_PERSISTENT
(package private) static String
RRD_DIR
note that .jrb files are NOT compatible with .rrd files(package private) static String
RRD_PREFIX
(package private) static String
RRD_SUFFIX
-
Constructor Summary
Constructors Constructor Description SummaryListener(Rate r)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(double totalValue, long eventCount, double totalEventTime, long period)
(package private) 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.boolean
equals(Object obj)
(package private) RrdBackendFactory
getBackendFactory()
(package private) RrdDb
getData()
(package private) String
getEventName()
(package private) String
getName()
Rate
getRate()
(package private) int
getRows()
int
hashCode()
(package private) long
now()
void
renderPng(OutputStream out)
void
renderPng(OutputStream out, int width, int height, boolean hideLegend, boolean hideGrid, boolean hideTitle, boolean showEvents, int periodCount, int end, boolean showCredit)
Single graph.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)
Single or two-data-source graph.boolean
startListening()
void
stopListening()
-
-
-
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:
add
in 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
-
-