Class MockMetric

  • All Implemented Interfaces:
    Metric

    public class MockMetric
    extends Object
    implements Metric
    Metric implementation for tests.
    Author:
    jonmv
    • Constructor Detail

      • MockMetric

        public MockMetric()
    • Method Detail

      • set

        public void set​(String key,
                        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​(String key,
                        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