blob: 22346f9a585180d752ba4991b9072ec55f64abcc (
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.model.admin.monitoring;
import java.util.Objects;
import java.util.Optional;
/**
* Monitoring service properties
*
* @author hmusum
*/
public class DefaultMonitoring implements Monitoring {
public static final int DEFAULT_MONITORING_INTERVAL = 1; // in minutes
private static final String DEFAULT_MONITORING_CLUSTER_NAME = "vespa";
private final Integer interval;
private final String clustername;
public DefaultMonitoring() {
this(DEFAULT_MONITORING_CLUSTER_NAME, Optional.empty());
}
public DefaultMonitoring(String clustername, Optional<Integer> interval) {
Objects.requireNonNull(clustername);
Objects.requireNonNull(interval);
this.clustername = clustername;
this.interval = interval.orElse(DEFAULT_MONITORING_INTERVAL);
}
@Override
public Integer getInterval() {
return interval;
}
@Override
public Integer getIntervalSeconds() {
return interval * 60;
}
@Override
public String getClustername() {
return clustername;
}
}
|