2 * Copyright (c) 2017 Red Hat, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.infrautils.metrics;
10 import org.opendaylight.infrautils.utils.UncheckedCloseable;
13 * Meter metric, which measures throughput.
15 * <p>Note that this with <tt>mark()</tt> measures the rate at which a set of events occur;
16 * whereas {@link Counter} is for things which will <tt>increase()</tt> - and can also <tt>decrease()</tt>.
18 public interface Meter extends UncheckedCloseable {
21 * Mark the occurrence of an event.
28 * Mark the occurrence of a given number of events.
30 void mark(long howMany);
33 * Gets the total number of events. Beware that this could have overflown.
34 * This is typically used in unit tests of metrics, more than to expose the metrics in production
35 * (because exposing metrics is really the role of the infrautils metrics implementation of this API).