formatting

This commit is contained in:
Jonathan Shook 2020-05-31 23:58:50 -05:00
parent 6d8443e6b8
commit d3b3490bc7
4 changed files with 7 additions and 6 deletions

View File

@ -90,9 +90,9 @@ public class MetricReporters implements Shutdownable {
}
}
public MetricReporters addGraphite(String host, int graphitePort, String prefix) {
public MetricReporters addGraphite(String host, int graphitePort, String globalPrefix) {
logger.debug("Adding graphite reporter to " + host + " with port " + graphitePort + " and prefix " + prefix);
logger.debug("Adding graphite reporter to " + host + " with port " + graphitePort + " and prefix " + globalPrefix);
if (metricRegistries.isEmpty()) {
throw new RuntimeException("There are no metric registries.");
@ -101,8 +101,9 @@ public class MetricReporters implements Shutdownable {
for (PrefixedRegistry prefixedRegistry : metricRegistries) {
Graphite graphite = new Graphite(new InetSocketAddress(host, graphitePort));
String _prefix = prefixedRegistry.prefix != null ? (!prefixedRegistry.prefix.isEmpty() ? globalPrefix + "." + prefixedRegistry.prefix : globalPrefix) : globalPrefix;
GraphiteReporter graphiteReporter = GraphiteReporter.forRegistry(prefixedRegistry.metricRegistry)
.prefixedWith(prefixedRegistry.prefix != null ? (!prefixedRegistry.prefix.isEmpty() ? prefix + "." + prefixedRegistry.prefix : prefix) : prefix)
.prefixedWith(_prefix)
.convertRatesTo(TimeUnit.SECONDS)
.convertDurationsTo(TimeUnit.NANOSECONDS)
.filter(ActivityMetrics.METRIC_FILTER)

View File

@ -39,9 +39,9 @@ public class NBCliIntegrationTests {
public void listWorkloadsTest() {
ProcessInvoker invoker = new ProcessInvoker();
invoker.setLogDir("logs/test");
ProcessResult result = invoker.run("workload-test", 15,
java, "-jar", JARNAME, "--logs-dir", "logs/test", "--list" +
"-workloads"
ProcessResult result = invoker.run(
"workload-test", 15, java, "-jar",
JARNAME, "--logs-dir", "logs/test", "--list-workloads"
);
System.out.println(result.getStdoutData());
System.out.println(result.getStderrData());