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

org.ow2.petals.probes.api.probes.CounterProbe Maven / Gradle / Ivy

/**
 * Copyright (c) 2012 EBMWebsourcing, 2012-2016 Linagora
 * 
 * This program/library is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 2.1 of the License, or (at your
 * option) any later version.
 * 
 * This program/library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
 * for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program/library; If not, see http://www.gnu.org/licenses/
 * for the GNU Lesser General Public License version 2.1.
 */
package org.ow2.petals.probes.api.probes;

import org.ow2.petals.probes.api.exceptions.ProbeNotInitializedException;
import org.ow2.petals.probes.api.exceptions.ProbeNotStartedException;

/**
 * 

* A simple gauge to count the instance number of something. *

*

* Lifecycle: The counter value is incremented only if the probe is started. Counter value can be acceded * even if the probe is initialized or stopped. Counter value is reset when the probe starts. *

* * @author Christophe DENEUX (PetalsLink) * */ public interface CounterProbe extends Probe { /** * Increments the value of the counter. * * @throws ProbeNotStartedException * The probe is not started. */ public void inc() throws ProbeNotStartedException; /** * Accessor to the counter value. * * @return The counter value since the last probe start. * @throws ProbeNotInitializedException * The probe is not initialized. */ public long getValue() throws ProbeNotInitializedException; }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy