aboutsummaryrefslogtreecommitdiffstats
path: root/metrics-proxy/src/main/java/ai/vespa/metricsproxy/telegraf/TelegrafRegistry.java
blob: 429da5bb933bdd677ba2d35ec7b21415eb891f6b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright 2020 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package ai.vespa.metricsproxy.telegraf;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * @author olaa
 */
public class TelegrafRegistry {

    private static final List<Telegraf> telegrafInstances = Collections.synchronizedList(new ArrayList<>());

    public void addInstance(Telegraf telegraf) {
        telegrafInstances.add(telegraf);
    }

    public void removeInstance(Telegraf telegraf) {
        telegrafInstances.remove(telegraf);
    }

    public boolean isEmpty() {
        return telegrafInstances.isEmpty();
    }
}