Package com.netflix.servo.monitor

Examples of com.netflix.servo.monitor.BasicCounter


        BasicCounter counter = getCounter(name);
        counter.increment();
    }

    private BasicCounter getCounter(String name) {
        BasicCounter counter = map.get(name);
        if (counter == null) {
            synchronized (lock) {
                counter = map.get(name);
                if (counter != null) {
                    return counter;
                }

                List<Tag> tags = new ArrayList<Tag>(2);
                tags.add(InjectableTag.HOSTNAME);
                tags.add(InjectableTag.IP);
                counter = new BasicCounter(MonitorConfig.builder(name).withTags(tags).build());
                map.putIfAbsent(name, counter);
                DefaultMonitorRegistry.getInstance().register(counter);
            }
        }
        return counter;
View Full Code Here


public class Meter {
    private BasicCounter counter;
    private long startTime;

    public Meter(MonitorConfig config) {
        counter = new BasicCounter(config);
        startTime = System.currentTimeMillis() - 1; // to prevent divided by 0
    }
View Full Code Here

TOP

Related Classes of com.netflix.servo.monitor.BasicCounter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.