Package com.yahoo.metrics.simple
Class PointBuilder
- java.lang.Object
-
- com.yahoo.metrics.simple.PointBuilder
-
public final class PointBuilder extends Object
Single-use builder for the immutable Point instances used to set dimensions for a metric. Get a fresh instance either from a corresponding Gauge or Counter, or through the MetricReceiver API.- Author:
- steinar
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PointBuilder.Discriminator
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Point
build()
Create a new Point instance using the settings stored in this PointBuilder.PointBuilder
set(String dimensionName, double dimensionValue)
Set a named dimension to a floating point value.PointBuilder
set(String dimensionName, long dimensionValue)
Set a named dimension to an integer value.PointBuilder
set(String dimensionName, String dimensionValue)
Set a named dimension to a string value.String
toString()
-
-
-
Method Detail
-
set
public PointBuilder set(String dimensionName, long dimensionValue)
Set a named dimension to an integer value.- Parameters:
dimensionName
- the name of the dimension to setdimensionValue
- to value for the given dimension- Returns:
- this, to facilitate chaining
-
set
public PointBuilder set(String dimensionName, double dimensionValue)
Set a named dimension to a floating point value.- Parameters:
dimensionName
- the name of the dimension to setdimensionValue
- to value for the given dimension- Returns:
- this, to facilitate chaining
-
set
public PointBuilder set(String dimensionName, String dimensionValue)
Set a named dimension to a string value.- Parameters:
dimensionName
- the name of the dimension to setdimensionValue
- to value for the given dimension- Returns:
- this, to facilitate chaining
-
build
public Point build()
Create a new Point instance using the settings stored in this PointBuilder. PointBuilder instances cannot be re-used after build() has been invoked.- Returns:
- a Point instance reflecting this builder
-
-