blob: 380a992aeadcb40c4621091aebad6991c4973bdc (
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
|
/*
* Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
*/
package ai.vespa.metricsproxy.service;
import ai.vespa.metricsproxy.metric.Metric;
import ai.vespa.metricsproxy.metric.Metrics;
/**
* @author Unknown
*/
public class DummyService extends VespaService {
static final String NAME = "dummy";
public static final String METRIC_1 = "c.test";
public static final String METRIC_2 = "val";
private final int num;
public DummyService(int num, String configid) {
super(NAME, NAME + num, configid);
this.num = num;
}
@Override
public Metrics getMetrics() {
Metrics m = new Metrics();
long timestamp = System.currentTimeMillis() / 1000;
m.add(new Metric(METRIC_1, 5 * num + 1, timestamp));
m.add(new Metric(METRIC_2, 1.3 * num + 1.05, timestamp));
return m;
}
}
|