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 Details

  • Constructor Details

    • SummaryListener

      public SummaryListener(Rate r)
  • Method Details

    • add

      public void add(double totalValue, long eventCount, double totalEventTime, long period)
      Specified by:
      add in interface RateSummaryListener
      Parameters:
      totalValue - sum of all event values in the most recent period
      eventCount - how many events occurred
      totalEventTime - how long the events were running for
      period - 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
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object