Class 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
    • 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 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
      • getEventName

        String getEventName()
      • getData

        RrdDb getData()
      • now

        long now()
      • getRows

        int getRows()
        Since:
        0.8.7
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object