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

com.oath.micro.server.spring.metrics.InstantGauge Maven / Gradle / Ivy

There is a newer version: 1.2.6
Show newest version
package com.oath.micro.server.spring.metrics;

import java.util.concurrent.atomic.AtomicLong;

import com.codahale.metrics.Gauge;


public class InstantGauge implements Gauge {

	private final AtomicLong counter = new AtomicLong(0l);

	@Override
	public Long getValue() {
		return counter.getAndSet(0l);
		}

	public void increment() {
		counter.incrementAndGet();
	}

	public void increase(long value) {
		counter.addAndGet(value);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy