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

no.finn.unleash.metric.ClientMetrics Maven / Gradle / Ivy

There is a newer version: 4.4.1
Show newest version
package no.finn.unleash.metric;

import no.finn.unleash.event.UnleashEvent;
import no.finn.unleash.event.UnleashSubscriber;
import no.finn.unleash.util.UnleashConfig;

public class ClientMetrics implements UnleashEvent {

    private final String appName;
    private final String instanceId;
    private final MetricsBucket bucket;

    ClientMetrics(UnleashConfig config, MetricsBucket bucket) {
        this.appName = config.getAppName();
        this.instanceId = config.getInstanceId();
        this.bucket = bucket;
    }

    public String getAppName() {
        return appName;
    }

    public String getInstanceId() {
        return instanceId;
    }

    public MetricsBucket getBucket() {
        return bucket;
    }

    @Override
    public void publishTo(UnleashSubscriber unleashSubscriber) {
        unleashSubscriber.clientMetrics(this);
    }

    @Override
    public String toString() {
        return "metrics:"
                + " appName=" + appName
                + " instanceId=" + instanceId
                ;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy