Class CountStatisticImpl

    • Constructor Detail

      • CountStatisticImpl

        public CountStatisticImpl​(String name)
        Constructs an instance of this class with following default values:
        • Unit is empty string.
        • Current Value is StatisticImpl#DEFAULT_VALUE.
        • Description is calculated from the name passed in. This may well be read from a properties file to address i18n.
        • LastSampleTime is time at the time of calling this method.
        • StartTime is the same as LastSampleTime.
        Parameters:
        name - String indicating the name of the statistic
      • CountStatisticImpl

        public CountStatisticImpl​(String name,
                                  String unit)
        Constructs an instance of this class with following default values:
        • Current Value is StatisticImpl#DEFAULT_VALUE.
        • Description is calculated from the name passed in. This may well be read from a properties file to address i18n.
        • LastSampleTime is time at the time of calling this method.
        • StartTime is the same as LastSampleTime.
        Parameters:
        name - String indicating the name of the statistic
        unit - String indicating the unit of the statistic
      • CountStatisticImpl

        public CountStatisticImpl​(String name,
                                  String unit,
                                  String desc)
        Constructs an instance of this class with following default values:
        • Description is calculated from the name passed in. This may well be read from a properties file to address i18n.
        • LastSampleTime is time at the time of calling this method.
        • StartTime is the same as LastSampleTime.
        Parameters:
        name - String indicating the name of the statistic
        unit - String indicating the unit of the statistic
        desc - A brief description of the statistic
      • CountStatisticImpl

        public CountStatisticImpl​(String name,
                                  String unit,
                                  long value)
        Constructs an instance of this class with following default values:
        • Description is calculated from the name passed in. This may well be read from a properties file to address i18n.
        • LastSampleTime is time at the time of calling this method.
        • StartTime is the same as LastSampleTime.
        Parameters:
        name - String indicating the name of the statistic
        unit - String indicating the unit of the statistic
        value - long indicating the unit of the statistic
      • CountStatisticImpl

        public CountStatisticImpl​(long countVal,
                                  String name,
                                  String unit,
                                  String desc,
                                  long sampleTime,
                                  long startTime)
        Constructs an immutable instance of CountStatistic with given parameters.
        Parameters:
        curVal - The current value of this statistic
        name - The name of the statistic
        unit - The unit of measurement for this statistic
        desc - A brief description of the statistic
        startTime - Time in milliseconds at which the measurement was started
        sampleTime - Time at which the last measurement was done.
    • Method Detail

      • getCount

        public long getCount()
        Returns the current value of this statistic.
        Specified by:
        getCount in interface CountStatistic
        Returns:
        long indicating current value