java.lang.Object
net.i2p.router.web.HelperBase
net.i2p.router.web.helpers.DebugOverviewHelper
Overview tiles and mini-graphs for the debug page entry point, one tile per debug tab summarizing what that tab shows, linking to it.
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final intNumber of mini-graphs shown, backfilled from other enabled stats.Human-readable labels for the priority stats, for the graph caption; backfilled stats fall back to their raw name.(package private) static final String[]Priority-ordered single-stat graph wishes, after bw.combined.Fields inherited from class HelperBase
_context, _log, _out, CHECKED, PROP_ADVANCED, SELECTEDModifier and TypeFieldDescriptionprotected RouterContextThe router context.protected LogThe log instance.protected WriterThe writer for output.static final StringChecked attribute for HTML checkboxes.static final StringProperty key for advanced mode.static final StringSelected attribute for HTML select options.Constructor Summary
ConstructorsConstructorDescriptionHelper bean that gathers the debug overview's tiles and mini-graphs.Method Summary
Modifier and TypeMethodDescription(package private) static StringBuild the mini-graph row for the given stats, at the standard graph size with grid but no legend or title - the tiny sidebar template is not used here.buildTiles(int services, int[] apps, int[] updates, long[] skmRouter, long[] skmClients, int[] streams, long[] dht) Build the ring cells in tab order: one per data-bearing debug tab (the DHT tab gets two, fill and fullest) plus one for active streams before it.Build the overview: tile grid then up to four recorded mini-graphs.pickGraphStats(Set<String> enabled) Pick up to GRAPH_COUNT stats to graph: bw.combined first when both bw rates are enabled, then the priority wish list, then a deterministic backfill from any other enabled stats so the row fills out.Methods inherited from class HelperBase
_t, _t, _t, _x, getChecked, isAdvanced, ngettext, setContextId, storeWriterModifier and TypeMethodDescriptionTranslate a string.Translate a string with a parameter.Translate a string with two parameters.static StringMark a string for extraction by xgettext and translation.protected StringgetChecked(String prop) Get the checked attribute for a boolean property.booleanCheck if advanced mode is enabled.Translate a string with plural forms (ngettext).voidsetContextId(String contextId) Configure this bean to query a particular router context.voidstoreWriter(Writer out) Store the writer for output.
Field Details
GRAPH_STATS
Priority-ordered single-stat graph wishes, after bw.combined.GRAPH_COUNT
static final int GRAPH_COUNTNumber of mini-graphs shown, backfilled from other enabled stats.- See Also:
GRAPH_LABELS
Constructor Details
DebugOverviewHelper
public DebugOverviewHelper()Helper bean that gathers the debug overview's tiles and mini-graphs.
Method Details
buildTiles
static List<String> buildTiles(int services, int[] apps, int[] updates, long[] skmRouter, long[] skmClients, int[] streams, long[] dht) Build the ring cells in tab order: one per data-bearing debug tab (the DHT tab gets two, fill and fullest) plus one for active streams before it. Null stat arrays mean the subsystem reported nothing and the cell degrades to a plain link tile. The SAM and translation tabs get no tile - translation is a pre-generated static report with no live data.- Parameters:
services- count of listening servicesapps- {tracked, running, registered} app counts, or nullupdates- {installed, downloaded, available} counts, or nullskmRouter- ratchet stats, see SessionKeyManager.getDebugStats, or nullskmClients- summed ratchet stats across client managers, or nullstreams- {inbound, outbound} open stream sockets, or nulldht- {keys, buckets, capacity, fullest} bucket stats, or null- Returns:
- one cell html string per tile, never null
getOverviewHTML
Build the overview: tile grid then up to four recorded mini-graphs.- Returns:
- the page html, never null
pickGraphStats
Pick up to GRAPH_COUNT stats to graph: bw.combined first when both bw rates are enabled, then the priority wish list, then a deterministic backfill from any other enabled stats so the row fills out. A single stat not in the router'sstat.summarieslist would make viewstat.jsp 400, so only enabled stats are ever shown.- Parameters:
enabled- names of stats with a graph listener- Returns:
- the stat names to graph, at most GRAPH_COUNT, never null
buildGraphs
Build the mini-graph row for the given stats, at the standard graph size with grid but no legend or title - the tiny sidebar template is not used here. bw.combined needs no period parameter (viewstat.jsp resolves it specially) and links to the plain graphs page. A single stat only draws when a period is given, so 60 one-minute buckets = 60 min.- Parameters:
stats- the stats to graph, non-emptynow- current time, used as a cache-busterlabels- translated display labels, stat name to caption- Returns:
- the graph div html, never null