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

com.ringcentral.platform.metrics.configs.builders.AbstractMeterConfigBuilder Maven / Gradle / Ivy

package com.ringcentral.platform.metrics.configs.builders;

import com.ringcentral.platform.metrics.MetricContext;
import com.ringcentral.platform.metrics.ModifiableMetricContext;
import com.ringcentral.platform.metrics.configs.MeterConfig;
import com.ringcentral.platform.metrics.configs.MeterInstanceConfig;
import com.ringcentral.platform.metrics.configs.MeterSliceConfig;
import com.ringcentral.platform.metrics.configs.MeterSliceConfig.LevelInstanceNameProvider;
import com.ringcentral.platform.metrics.labels.Label;
import com.ringcentral.platform.metrics.labels.LabelValues;
import com.ringcentral.platform.metrics.labels.LabelValuesPredicate;
import com.ringcentral.platform.metrics.impl.MetricImplConfigBuilder;
import com.ringcentral.platform.metrics.measurables.Measurable;
import com.ringcentral.platform.metrics.names.MetricName;

import java.time.Duration;
import java.time.temporal.ChronoUnit;
import java.util.*;

import static com.ringcentral.platform.metrics.names.MetricName.emptyMetricName;
import static com.ringcentral.platform.metrics.utils.CollectionUtils.containsAllInOrder;
import static com.ringcentral.platform.metrics.utils.Preconditions.checkArgument;
import static com.ringcentral.platform.metrics.utils.Preconditions.checkState;
import static java.util.Collections.emptyMap;
import static java.util.Collections.emptySet;
import static java.util.Objects.requireNonNull;
import static java.util.stream.Collectors.toCollection;
import static java.util.stream.Collectors.toMap;

@SuppressWarnings({ "unchecked", "unused", "BooleanMethodIsAlwaysInverted" })
public abstract class AbstractMeterConfigBuilder<
    M extends Measurable,
    IC extends MeterInstanceConfig,
    SC extends MeterSliceConfig,
    C extends MeterConfig,
    ASCB extends AbstractMeterConfigBuilder.AllSliceConfigBuilder,
    SCB extends AbstractMeterConfigBuilder.SliceConfigBuilder,
    CB extends AbstractMeterConfigBuilder>
        extends AbstractMetricConfigBuilder implements MetricConfigBuilder {

    protected static abstract class AbstractSliceConfigBuilder<
        M extends Measurable,
        IC extends MeterInstanceConfig,
        SC extends MeterSliceConfig,
        C extends MeterConfig,
        ASCB extends AllSliceConfigBuilder,
        SCB extends SliceConfigBuilder,
        CB extends AbstractMeterConfigBuilder,
        Impl extends AbstractSliceConfigBuilder>
            implements MetricConfigBuilderProvider {

        final CB builder;

        Boolean enabled;
        MetricName name;

        List




© 2015 - 2024 Weber Informatics LLC | Privacy Policy