Package com.yahoo.jdisc.test
Class MockMetric
- java.lang.Object
-
- com.yahoo.jdisc.test.MockMetric
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.yahoo.jdisc.Metric
Metric.Context
-
-
Constructor Summary
Constructors Constructor Description MockMetric()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(String key, Number val, Metric.Context ctx)
Add to a metric value.Metric.Context
createContext(Map<String,?> properties)
Creates aMetricConsumer
-specificMetric.Context
object that encapsulates the given properties.Map<String,Map<Map<String,?>,Double>>
metrics()
void
set(String key, Number val, Metric.Context ctx)
Set a metric value.String
toString()
-
-
-
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.
-
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.
-
createContext
public Metric.Context createContext(Map<String,?> properties)
Description copied from interface:Metric
Creates aMetricConsumer
-specificMetric.Context
object that encapsulates the given properties. The returned Context object should be passed along every future call toMetric.set(String, Number, Context)
andMetric.add(String, Number, Context)
where the properties match those given here.- Specified by:
createContext
in interfaceMetric
- Parameters:
properties
- the properties to incorporate in the context- Returns:
- the created context
-
-