Class SimpleTimerMetric

    • Field Detail

      • m_count

        protected long m_count
      • m_dataLock

        protected final Object m_dataLock
      • reportZero

        protected boolean reportZero
        Report zero values during interval if no data is received.
    • Constructor Detail

      • SimpleTimerMetric

        public SimpleTimerMetric()
      • SimpleTimerMetric

        public SimpleTimerMetric​(ChronoUnit unit,
                                 boolean reportZero)
    • Method Detail

      • setReportUnit

        public void setReportUnit​(ChronoUnit reportUnit)
        Description copied from class: TimerCollector
        Unit to report metric as. Supported units are NANOS, MICROS, MILLIS, SECONDS, MINUTES, HOURS, DAYS
        Overrides:
        setReportUnit in class TimerCollector
        Parameters:
        reportUnit - Time unit
      • getCount

        public long getCount()
        Not thread safe
        Returns:
        Call count
      • put

        public void put​(Duration duration)
        Description copied from interface: DurationCollector
        Place a Duration value into the collector to be reported. The actual value reported is determined by the collector implementation that is configured for this source.
        Specified by:
        put in interface DurationCollector
        Parameters:
        duration - Value to be reported.
      • put

        public void put​(Instant time,
                        Duration duration)
        Description copied from interface: DurationCollector
        Place a Duration value and associated timestamp into the collector to be reported. The actual value and time reported is determined by the collector implementation that is configured for this source.
        Specified by:
        put in interface DurationCollector
        Parameters:
        time - Suggested timestamp to use when reporting.
        duration - Value to be reported.
      • clone

        public Collector clone()
        Description copied from interface: Collector
        The first instance of a collector is unmarshalled from configuration using hocon, all other instances are cloned from that first one so the clone method should pass along any configuration that was set.
        Specified by:
        clone in interface Collector
        Specified by:
        clone in class TimerCollector
        Returns:
        Clone of this collector