Skip to content

Commit

Permalink
Bump up dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiaodong Xie committed Apr 5, 2018
1 parent f2104de commit 0995817
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,11 @@ protected InfluxDbReporter.Builder builder(MetricRegistry registry) {

assertThat(getField(influxDb, InfluxDbUdpSender.class, "socketTimeout")).isEqualTo(3000);
}

@Test
public void shouldSetProtocolAndDefaultToHttp() {
assertThat(factory.getProtocol()).isEqualTo("http");
factory.setProtocol("tcp");
assertThat(factory.getProtocol()).isEqualTo("tcp");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.izettle.metrics.dw;

import com.izettle.metrics.dw.tags.NoopTransformer;
import org.assertj.core.api.Assertions;
import org.junit.Test;

public class NoopTransformerTest {

@Test
public void shouldDoNoTransform() {
Assertions.assertThat(new NoopTransformer().getTags("com.izettle.metrics.influxdb.tags.NoopTransformer.count"))
.containsEntry("metricName", "com.izettle.metrics.influxdb.tags.NoopTransformer.count");
}
}
4 changes: 2 additions & 2 deletions metrics-influxdb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-clients</artifactId>
<version>0.11.0.0</version>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>io.dropwizard.metrics</groupId>
Expand All @@ -44,7 +44,7 @@
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.9</version>
<version>1.11</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ abstract class InfluxDbBaseSender implements InfluxDbSender {

@Override
public void flush() {
influxDbWriteObject.setPoints(new HashSet<InfluxDbPoint>());
influxDbWriteObject.setPoints(new HashSet<>());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
public class NoopTransformer implements Transformer {
@Override
public Map<String, String> getTags(String metricName) {
Map<String, String> tags = new HashMap<String, String>();
Map<String, String> tags = new HashMap<>();
tags.put("metricName", metricName);
return tags;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class InfluxDbReporterTest {

@Before
public void init() {
globalTags = new HashMap<String, String>();
globalTags = new HashMap<>();
globalTags.put("global", "tag001");
MockitoAnnotations.initMocks(this);
reporter = InfluxDbReporter
Expand Down Expand Up @@ -267,11 +267,11 @@ public void shouldMapMeasurementToDefinedMeasurementNameAndRegex() {
.build(influxDb);

reporter.report(
this.<Gauge>map(),
this.<Counter>map(),
this.<Histogram>map(),
this.map(),
this.map(),
this.map(),
this.map("com.example.resources.RandomResource", mock(Meter.class)),
this.<Timer>map()
this.map()
);

final ArgumentCaptor<InfluxDbPoint> influxDbPointCaptor = ArgumentCaptor.forClass(InfluxDbPoint.class);
Expand All @@ -293,11 +293,11 @@ public void shouldNotMapMeasurementToDefinedMeasurementNameAndRegex() {
.build(influxDb);

reporter.report(
this.<Gauge>map(),
this.<Counter>map(),
this.<Histogram>map(),
this.map(),
this.map(),
this.map(),
this.map("com.example.resources.RandomResource", mock(Meter.class)),
this.<Timer>map()
this.map()
);

final ArgumentCaptor<InfluxDbPoint> influxDbPointCaptor = ArgumentCaptor.forClass(InfluxDbPoint.class);
Expand Down Expand Up @@ -519,12 +519,12 @@ public void shouldSkipIdleMetrics() throws Exception {

@Test
public void shouldCatchExceptions() throws Exception {
doThrow(ConnectException.class).when(influxDb).flush();
reporter
.report(map("gauge", gauge((byte) 1)), this.<Counter>map(), this.<Histogram>map(), this.<Meter>map(), this.<Timer>map());
doThrow(IOException.class).when(influxDb).flush();
reporter
.report(map("gauge", gauge((byte) 1)), this.<Counter>map(), this.<Histogram>map(), this.<Meter>map(), this.<Timer>map());
doThrow(ConnectException.class).when(influxDb).writeData();
reporter.report(map("gauge", gauge((byte) 1)), this.map(), this.map(), this.map(), this.map());
doThrow(IOException.class).when(influxDb).writeData();
reporter.report(map("gauge", gauge((byte) 1)), this.map(), this.map(), this.map(), this.map());
doThrow(RuntimeException.class).when(influxDb).flush();
reporter.report(map("gauge", gauge((byte) 1)), this.map(), this.map(), this.map(), this.map());
}


Expand Down
11 changes: 5 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.izettle</groupId>
<artifactId>izettle-oss</artifactId>
<version>1.14</version>
<version>1.18</version>
<relativePath />
</parent>
<artifactId>metrics-parent</artifactId>
Expand Down Expand Up @@ -37,14 +37,13 @@
</modules>

<properties>
<dropwizard.version>1.0.0</dropwizard.version>
<dropwizard.version>1.3.1</dropwizard.version>
</properties>

<build>
<plugins>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.4.1</version>
<executions>
<execution>
<id>enforce</id>
Expand Down Expand Up @@ -98,12 +97,12 @@
<plugin>
<groupId>org.eluder.coveralls</groupId>
<artifactId>coveralls-maven-plugin</artifactId>
<version>4.0.0</version>
<version>4.3.0</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.3</version>
<version>${findbugs-maven-plugin.version}</version>
<configuration>
<effort>Max</effort>
<threshold>Low</threshold>
Expand All @@ -115,7 +114,7 @@
<plugin>
<groupId>com.h3xstream.findsecbugs</groupId>
<artifactId>findsecbugs-plugin</artifactId>
<version>1.4.5</version>
<version>1.7.1</version>
</plugin>
</plugins>
</configuration>
Expand Down

0 comments on commit 0995817

Please sign in to comment.