Metrics

Zoltar provides a way to attach and extend metrics around Predictor.

zoltar-metrics takes advantage of the semantic-metrics to be able to capture meaningful metrics.

Getting Started

Add zoltar-metrics dependency to your project:

Maven
<dependency>
  <groupId>com.spotify</groupId>
  <artifactId>zoltar-metrics</artifactId>
  <version>0.4.0</version>
</dependency>
Gradle
dependencies {
  compile group: 'com.spotify', name: 'zoltar-metrics', version: '0.4.0'
}
sbt
libraryDependencies += "com.spotify" % "zoltar-metrics" % "0.4.0"

Create a semantic registry:

final SemanticMetricRegistry registry = new SemanticMetricRegistry();
final MetricId metricId = MetricId.build().tagged("service", "my-application");

Attach it to the PredictorBuilder:

final PredictorMetrics<Integer, Float, Float> predictorMetrics =
    SemanticPredictorMetrics.create(metricRegistry, metricId);
Predictors
    .newBuilder(modelLoader, featureExtractor, predictFn, predictorMetrics)

Example

Follow this example to see how you can create new set of metrics and attach them.