diff options
author | gjoranv <gv@verizonmedia.com> | 2019-03-22 13:28:23 +0100 |
---|---|---|
committer | gjoranv <gv@verizonmedia.com> | 2019-05-02 15:46:48 +0200 |
commit | 099bde8f27218e97c5da33ce8bde5a796a1c0f5a (patch) | |
tree | b10a308c52557b655bf684569dc1772f7e0aca0b /metrics-proxy/src/test/java/ai/vespa/metricsproxy/TestUtil.java | |
parent | dd219ffd3416e1a752c50d92dfb8461e4689510a (diff) |
New metrics-proxy
* Configs for services, monitoring, consumers, dimensions, rpc-connector
* Add a provider for SystemPoller to simplify migration to DI.
* Add test and test utils for ConfigSentinelClient.
* Add package-info files.
* Add MetricsConsumers class.
* Extract separate classes and configs for app and node dims.
* Add RpcConnector as a long-lived owner of the rpc Supervisor.
* Move service updating from VespaMetrics to MetricsManager.
* Move service dimensions to VespaService.
* Rename service.id to 'configId' in vespa-services.def.
Diffstat (limited to 'metrics-proxy/src/test/java/ai/vespa/metricsproxy/TestUtil.java')
-rw-r--r-- | metrics-proxy/src/test/java/ai/vespa/metricsproxy/TestUtil.java | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/metrics-proxy/src/test/java/ai/vespa/metricsproxy/TestUtil.java b/metrics-proxy/src/test/java/ai/vespa/metricsproxy/TestUtil.java new file mode 100644 index 00000000000..c5104d65b26 --- /dev/null +++ b/metrics-proxy/src/test/java/ai/vespa/metricsproxy/TestUtil.java @@ -0,0 +1,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; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; + +/** + * Utilities for tests in this module. + * + * @author hmusum + */ +public class TestUtil { + + public static String getContents(File aFile) { + //...checks on aFile are elided + StringBuilder contents = new StringBuilder(); + + try (BufferedReader input = new BufferedReader(new FileReader(aFile))) { + String line; + while ((line = input.readLine()) != null) { + contents.append(line); + contents.append(System.getProperty("line.separator")); + } + } catch (IOException ex) { + ex.printStackTrace(); + } + + return contents.toString(); + } + +} |