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

com.commercetools.sunrise.framework.controllers.metrics.SphereClientMetricsObserver Maven / Gradle / Ivy

There is a newer version: 1.0.0-M10
Show newest version
package com.commercetools.sunrise.framework.controllers.metrics;

import io.sphere.sdk.client.metrics.ObservedTotalDuration;

import java.util.ArrayList;
import java.util.List;
import java.util.Observable;
import java.util.Observer;

final class SphereClientMetricsObserver implements Observer {

    private final List metrics = new ArrayList<>();

    @Override
    public void update(final Observable o, final Object arg) {
        if (arg instanceof ObservedTotalDuration) {
            metrics.add((ObservedTotalDuration) arg);
        }
    }

    public List getMetrics() {
        return metrics;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy