jenes.statistics

Class StatisticsLogger

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class and Description
      static interface  StatisticsLogger.Loggable
      Annotation for methods providing some figure in a LoggableStatistics object.
      static class  StatisticsLogger.LoggableStatistics
      This class provides the support for making a statistics loggable.
    • Constructor Summary

      Constructors 
      Constructor and Description
      StatisticsLogger(AbstractLogger logger, java.lang.String... figures)
      Creastes a StatisticsLogger.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      void add(java.lang.String prefix, java.lang.String key, java.lang.Object value)
      Add a value into the current record.
      void close()
      Closes the undelying logger.
      protected void finalize() 
      AbstractLogger getLogger()
      Returns the logger used for storing the statistics.
      void log()
      Logs a current record by storing it and making the record empty
      void record(StatisticsLogger.LoggableStatistics statistics)
      Store a new statistic record in the logger.
      void record(java.lang.String prefix, StatisticsLogger.LoggableStatistics statistics)
      Store a new statistic record in the logger.
      void record(java.lang.String prefix, StatisticsLogger.LoggableStatistics statistics, boolean log)
      Store a new statistic record in the logger.
      void save()
      Saves the undelying logger.
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StatisticsLogger

        public StatisticsLogger(AbstractLogger logger,
                        java.lang.String... figures)
        Creastes a StatisticsLogger. If figures is empty, no filter is applied and all statistics are able to be saved.
        Parameters:
        logger - - the logger used to save the statistics
        figures - - the figures that we are interested to save
    • Method Detail

      • record

        public void record(StatisticsLogger.LoggableStatistics statistics)
        Store a new statistic record in the logger.
        Parameters:
        statistics - - the statistics being logged.
      • record

        public void record(java.lang.String prefix,
                  StatisticsLogger.LoggableStatistics statistics)
        Store a new statistic record in the logger.
        Parameters:
        prefix - - the prefix of statistics name
        statistics - - the statistics being logged.
      • record

        public void record(java.lang.String prefix,
                  StatisticsLogger.LoggableStatistics statistics,
                  boolean log)
        Store a new statistic record in the logger.
        Parameters:
        prefix - - the prefix of statistics name
        statistics - - the statistics being logged.
        log - - if true logs a current record by storing it and making the record empty.
      • add

        public void add(java.lang.String prefix,
               java.lang.String key,
               java.lang.Object value)
        Add a value into the current record.
        Parameters:
        prefix - - the prefix of statistics name
        key - - the statistics name
        value - - the statistics value
      • getLogger

        public AbstractLogger getLogger()
        Returns the logger used for storing the statistics.
        Returns:
        the logger
      • log

        public void log()
        Logs a current record by storing it and making the record empty
      • save

        public void save()
        Saves the undelying logger.
      • close

        public void close()
        Closes the undelying logger.
      • finalize

        protected void finalize()
        Overrides:
        finalize in class java.lang.Object