@Override public final void close() throws Exception { MetricRegistry registry = getOpletContext().getService(MetricRegistry.class); if (registry != null) { registry.remove(getMetricName()); } } }
@Override public final void initialize(OpletContext<T, T> context) { super.initialize(context); MetricRegistry registry = context.getService(MetricRegistry.class); if (registry != null) { this.metricName = context.uniquify(shortMetricName); registry.register(getMetricName(), getMetric()); } }