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

io.reactivex.netty.spectator.SpectatorUtils Maven / Gradle / Ivy

There is a newer version: 0.5.1
Show newest version
package io.reactivex.netty.spectator;

import com.netflix.spectator.api.Counter;
import com.netflix.spectator.api.ExtendedRegistry;
import com.netflix.spectator.api.Id;
import com.netflix.spectator.api.Spectator;
import com.netflix.spectator.api.Timer;

public final class SpectatorUtils {
    private SpectatorUtils() {
    }

    public static Counter newCounter(String name, String id) {
        return Spectator.registry().counter(name, "id", id);
    }

    public static Timer newTimer(String name, String id) {
        return Spectator.registry().timer(name, "id", id);
    }

    public static  T newGauge(String name, String id, T number) {
        final ExtendedRegistry registry = Spectator.registry();
        Id gaugeId = registry.createId(name, "id", id);
        return registry.gauge(gaugeId, number);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy