All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opendaylight.serviceutils.metrics.Timer Maven / Gradle / Ivy

There is a newer version: 0.14.0
Show newest version
/*
 * Copyright (c) 2017 Red Hat, Inc. and others. All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/epl-v10.html
 */
package org.opendaylight.serviceutils.metrics;

import org.opendaylight.serviceutils.metrics.function.CheckedCallable;
import org.opendaylight.serviceutils.metrics.function.CheckedRunnable;
import org.opendaylight.yangtools.concepts.Registration;

/**
 * A timer metric which aggregates timing durations.
 */
public interface Timer extends Registration {

    /**
     * Times and records the duration of event which returns a value.
     */
     T time(CheckedCallable event) throws E;

    /**
     * Times and records the duration of event.
     */
     void time(CheckedRunnable event) throws E;

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy