java.lang.Object
net.i2p.router.web.HelperBase
net.i2p.router.web.helpers.DebugOverviewHelper

public class DebugOverviewHelperextends HelperBase
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 Details

    • GRAPH_STATS

      static final String[] GRAPH_STATS
      Priority-ordered single-stat graph wishes, after bw.combined.
    • GRAPH_COUNT

      static final int GRAPH_COUNT
      Number of mini-graphs shown, backfilled from other enabled stats.
      See Also:
    • GRAPH_LABELS

      static final Map<String,String> GRAPH_LABELS
      Human-readable labels for the priority stats, for the graph caption; backfilled stats fall back to their raw name. Values are translated at render time.
  • 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 services
      apps - {tracked, running, registered} app counts, or null
      updates - {installed, downloaded, available} counts, or null
      skmRouter - ratchet stats, see SessionKeyManager.getDebugStats, or null
      skmClients - summed ratchet stats across client managers, or null
      streams - {inbound, outbound} open stream sockets, or null
      dht - {keys, buckets, capacity, fullest} bucket stats, or null
      Returns:
      one cell html string per tile, never null
    • getOverviewHTML

      public String getOverviewHTML()
      Build the overview: tile grid then up to four recorded mini-graphs.
      Returns:
      the page html, never null
    • pickGraphStats

      static List<String> 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. A single stat not in the router's stat.summaries list 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

      static String buildGraphs(List<String> stats, long now, Map<String,String> labels)
      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-empty
      now - current time, used as a cache-buster
      labels - translated display labels, stat name to caption
      Returns:
      the graph div html, never null