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

org.kie.perf.SharedMetricRegistry Maven / Gradle / Ivy

There is a newer version: 7.74.1.Final
Show newest version
package org.kie.perf;

import com.codahale.metrics.MetricRegistry;

public class SharedMetricRegistry {

    private static MetricRegistry instance;
    private static boolean isWarmUp = false;
    private static MetricRegistry warmUpInstance;

    private SharedMetricRegistry() {

    }

    public static void setWarmUp(boolean isWarmUp) {
        SharedMetricRegistry.isWarmUp = isWarmUp;
    }

    public static MetricRegistry getInstance() {
        if (isWarmUp) {
            if (warmUpInstance == null) {
                warmUpInstance = new MetricRegistry();
            }
            return warmUpInstance;
        }
        if (instance == null) {
            instance = new MetricRegistry();
        }
        return instance;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy