/** * Adds the given count to the given metric. * * @param metric The {@link AbsoluteCountMetric} to add the count. * @param count The count to add to it. */ protected void updateCount(AbsoluteCountMetric metric, long count) { if (metricsEnabled) { metric.add(count); } }
/** * Registers a metric that counts values monotonically increasing with the configured interval for it (if any). * * @param name The name of the metric to register. * @param context The {@link TopologyContext} to register the metric for. * @return The registered {@link AbsoluteCountMetric} that is counting. */ protected AbsoluteCountMetric registerAbsoluteCountMetric(String name, TopologyContext context) { return registerMetric(new AbsoluteCountMetric(), name, context); }
/** * Registers a metric that counts values monotonically increasing with the configured interval for it (if any). * * @param name The name of the metric to register. * @param context The {@link TopologyContext} to register the metric for. * @return The registered {@link AbsoluteCountMetric} that is counting. */ protected AbsoluteCountMetric registerAbsoluteCountMetric(String name, TopologyContext context) { return registerMetric(new AbsoluteCountMetric(), name, context); }
/** * Adds the given count to the given metric. * * @param metric The {@link AbsoluteCountMetric} to add the count. * @param count The count to add to it. */ protected void updateCount(AbsoluteCountMetric metric, long count) { if (metricsEnabled) { metric.add(count); } }