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

com.ringcentral.platform.metrics.MetricRegistry Maven / Gradle / Ivy

The newest version!
package com.ringcentral.platform.metrics;

import com.ringcentral.platform.metrics.configs.builders.*;
import com.ringcentral.platform.metrics.counter.Counter;
import com.ringcentral.platform.metrics.counter.configs.CounterConfig;
import com.ringcentral.platform.metrics.histogram.Histogram;
import com.ringcentral.platform.metrics.histogram.configs.HistogramConfig;
import com.ringcentral.platform.metrics.predicates.*;
import com.ringcentral.platform.metrics.rate.Rate;
import com.ringcentral.platform.metrics.rate.configs.RateConfig;
import com.ringcentral.platform.metrics.timer.Timer;
import com.ringcentral.platform.metrics.timer.configs.TimerConfig;
import com.ringcentral.platform.metrics.var.doubleVar.*;
import com.ringcentral.platform.metrics.var.doubleVar.configs.*;
import com.ringcentral.platform.metrics.var.longVar.*;
import com.ringcentral.platform.metrics.var.longVar.configs.*;
import com.ringcentral.platform.metrics.var.objectVar.*;
import com.ringcentral.platform.metrics.var.objectVar.configs.*;
import com.ringcentral.platform.metrics.var.stringVar.*;
import com.ringcentral.platform.metrics.var.stringVar.configs.*;

import java.util.Map;
import java.util.function.Supplier;

public interface MetricRegistry {
    void addListener(MetricRegistryListener listener);

    Map metrics();
    void remove(MetricKey key);

    default void preConfigure(MetricNamedPredicateBuilder predicateBuilder, MetricModBuilder modBuilder) {
        preConfigure(predicateBuilder.build(), modBuilder);
    }

    void preConfigure(MetricNamedPredicate predicate, MetricModBuilder modBuilder);

    default void postConfigure(MetricNamedPredicateBuilder predicateBuilder, MetricModBuilder modBuilder) {
        postConfigure(predicateBuilder.build(), modBuilder);
    }

    void postConfigure(MetricNamedPredicate predicate, MetricModBuilder modBuilder);

    /* Object var */

    ObjectVar objectVar(MetricKey key, Supplier valueSupplier);

     ObjectVar objectVar(
        MetricKey key,
        Supplier valueSupplier,
        Supplier>> configBuilderProviderSupplier);

    ObjectVar newObjectVar(MetricKey key, Supplier valueSupplier);

     ObjectVar newObjectVar(
        MetricKey key,
        Supplier valueSupplier,
        Supplier>> configBuilderProviderSupplier);

    /* Caching object var */

    CachingObjectVar cachingObjectVar(MetricKey key, Supplier valueSupplier);

     CachingObjectVar cachingObjectVar(
        MetricKey key,
        Supplier valueSupplier,
        Supplier>> configBuilderProviderSupplier);

    CachingObjectVar newCachingObjectVar(MetricKey key, Supplier valueSupplier);

     CachingObjectVar newCachingObjectVar(
        MetricKey key,
        Supplier valueSupplier,
        Supplier>> configBuilderProviderSupplier);

    /* Long var */

    LongVar longVar(MetricKey key, Supplier valueSupplier);

     LongVar longVar(
        MetricKey key,
        Supplier valueSupplier,
        Supplier>> configBuilderProviderSupplier);

    LongVar newLongVar(MetricKey key, Supplier valueSupplier);

     LongVar newLongVar(
        MetricKey key,
        Supplier valueSupplier,
        Supplier>> configBuilderProviderSupplier);

    /* Caching long var */

    CachingLongVar cachingLongVar(MetricKey key, Supplier valueSupplier);

     CachingLongVar cachingLongVar(
        MetricKey key,
        Supplier valueSupplier,
        Supplier>> configBuilderProviderSupplier);

    CachingLongVar newCachingLongVar(MetricKey key, Supplier valueSupplier);

     CachingLongVar newCachingLongVar(
        MetricKey key,
        Supplier valueSupplier,
        Supplier>> configBuilderProviderSupplier);

    /* Double var */

    DoubleVar doubleVar(MetricKey key, Supplier valueSupplier);

     DoubleVar doubleVar(
        MetricKey key,
        Supplier valueSupplier,
        Supplier>> configBuilderProviderSupplier);

    DoubleVar newDoubleVar(MetricKey key, Supplier valueSupplier);

     DoubleVar newDoubleVar(
        MetricKey key,
        Supplier valueSupplier,
        Supplier>> configBuilderProviderSupplier);

    /* Caching double var */

    CachingDoubleVar cachingDoubleVar(MetricKey key, Supplier valueSupplier);

     CachingDoubleVar cachingDoubleVar(
        MetricKey key,
        Supplier valueSupplier,
        Supplier>> configBuilderProviderSupplier);

    CachingDoubleVar newCachingDoubleVar(MetricKey key, Supplier valueSupplier);

     CachingDoubleVar newCachingDoubleVar(
        MetricKey key,
        Supplier valueSupplier,
        Supplier>> configBuilderProviderSupplier);

    /* String var */

    StringVar stringVar(MetricKey key, Supplier valueSupplier);

     StringVar stringVar(
        MetricKey key,
        Supplier valueSupplier,
        Supplier>> configBuilderProviderSupplier);

    StringVar newStringVar(MetricKey key, Supplier valueSupplier);

     StringVar newStringVar(
        MetricKey key,
        Supplier valueSupplier,
        Supplier>> configBuilderProviderSupplier);

    /* Caching string var */

    CachingStringVar cachingStringVar(MetricKey key, Supplier valueSupplier);

     CachingStringVar cachingStringVar(
        MetricKey key,
        Supplier valueSupplier,
        Supplier>> configBuilderProviderSupplier);

    CachingStringVar newCachingStringVar(MetricKey key, Supplier valueSupplier);

     CachingStringVar newCachingStringVar(
        MetricKey key,
        Supplier valueSupplier,
        Supplier>> configBuilderProviderSupplier);

    /* Counter */

    Counter counter(MetricKey key);

     Counter counter(
        MetricKey key,
        Supplier>> configBuilderProviderSupplier);

    Counter newCounter(MetricKey key);

     Counter newCounter(
        MetricKey key,
        Supplier>> configBuilderProviderSupplier);

    /* Rate */

    Rate rate(MetricKey key);

     Rate rate(
        MetricKey key,
        Supplier>> configBuilderProviderSupplier);

    Rate newRate(MetricKey key);

     Rate newRate(
        MetricKey key,
        Supplier>> configBuilderProviderSupplier);

    /* Histogram */

    Histogram histogram(MetricKey key);

     Histogram histogram(
        MetricKey key,
        Supplier>> configBuilderProviderSupplier);

    Histogram newHistogram(MetricKey key);

     Histogram newHistogram(
        MetricKey key,
        Supplier>> configBuilderProviderSupplier);

    /* Timer */

    Timer timer(MetricKey key);

     Timer timer(
        MetricKey key,
        Supplier>> configBuilderProviderSupplier);

    Timer newTimer(MetricKey key);

     Timer newTimer(
        MetricKey key,
        Supplier>> configBuilderProviderSupplier);
}