Class CallTimeMetric


  • public class CallTimeMetric
    extends java.lang.Object
    Simple mechanism to track how much time we're spending in various calls
    • Constructor Summary

      Constructors 
      Constructor Description
      CallTimeMetric​(java.lang.String fullMetricName, java.lang.String metricName)
      Constructor to create a metric to track the performance of a call or span of code
    • Constructor Detail

      • CallTimeMetric

        public CallTimeMetric​(java.lang.String fullMetricName,
                              java.lang.String metricName)
        Constructor to create a metric to track the performance of a call or span of code
        Parameters:
        fullMetricName -
        metricName -
    • Method Detail

      • getFullMetricName

        public java.lang.String getFullMetricName()
        Get the full name of the metric (path + name)
        Returns:
      • getAccumulatedTime

        public long getAccumulatedTime()
        Returns:
        the accumulatedTime
      • accumulateTime

        public void accumulateTime​(long nanos)
        Add nanos to the accumulated time and increment the call count
        Parameters:
        nanos - the time to add in nanoseconds
      • accumulateItems

        public void accumulateItems​(int count)
        Add count to the itemCount
        Parameters:
        count -
      • getItemCount

        public long getItemCount()
        Get the current item count
        Returns:
      • getCallCount

        public long getCallCount()
        Returns:
        the callCount
      • getMetricName

        public java.lang.String getMetricName()
        Returns:
        the metricName
      • render

        public static void render​(java.util.logging.Logger logger,
                                  java.util.List<CallTimeMetric> metrics)
        Render the collection of metrics as a series of fine log messages
        Parameters:
        logger -
        metrics -