Class MockMetric

  • All Implemented Interfaces:
    Metric

    public class MockMetric
    extends java.lang.Object
    implements Metric
    Metric implementation for tests.
    Author:
    jonmv
    • Nested Class Summary

    • Constructor Summary

      Constructors 
      Constructor Description
      MockMetric()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(java.lang.String key, java.lang.Number val, Metric.Context ctx)
      Add to a metric value.
      Metric.Context createContext​(java.util.Map<java.lang.String,​?> properties)
      Creates a MetricConsumer-specific Metric.Context object that encapsulates the given properties.
      java.util.Map<java.lang.String,​java.util.Map<java.util.Map<java.lang.String,​?>,​java.lang.Double>> metrics()  
      void set​(java.lang.String key, java.lang.Number val, Metric.Context ctx)
      Set a metric value.
      • Methods inherited from class java.lang.Object

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

      • MockMetric

        public MockMetric()
    • Method Detail

      • set

        public void set​(java.lang.String key,
                        java.lang.Number val,
                        Metric.Context ctx)
        Description copied from interface: Metric
        Set a metric value. This is typically used with histogram-type metrics.
        Specified by:
        set in interface Metric
        Parameters:
        key - The name of the metric to modify.
        val - The value to assign to the named metric.
        ctx - The context to further describe this entry.
      • add

        public void add​(java.lang.String key,
                        java.lang.Number val,
                        Metric.Context ctx)
        Description copied from interface: Metric
        Add to a metric value. This is typically used with counter-type metrics.
        Specified by:
        add in interface Metric
        Parameters:
        key - the name of the metric to modify
        val - the value to add to the named metric
        ctx - the context to further describe this entry
      • metrics

        public java.util.Map<java.lang.String,​java.util.Map<java.util.Map<java.lang.String,​?>,​java.lang.Double>> metrics()