Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>com.bealetech</groupId>
<artifactId>metrics-statsd</artifactId>
<name>Metrics Statsd Support</name>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0-CAPGEMINI</version>
<packaging>jar</packaging>
<url>http://github.com/organicveggie/metrics-statsd/</url>
<description>Statsd reporter for codahale/metrics.</description>
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/bealetech/metrics/reporting/Statsd.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ public void send(String name, String value, StatType statType) throws IOExceptio
public void close() throws IOException {
DatagramPacket packet = newPacket(outputData);

logger.trace("Sending {} bytes of data to StatsD ", outputData.size());
packet.setData(outputData.toByteArray());
logger.trace("Monitoring data to be sent to StatsD is :: {}", outputData.toString());
datagramSocket.send(packet);

if(datagramSocket != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ public void report(SortedMap<String, Gauge> gauges,
SortedMap<String, Timer> timers) {

try {
LOGGER.trace("StatsD reporter triggered");
statsd.connect();

for (Map.Entry<String, Gauge> entry : gauges.entrySet()) {
Expand Down Expand Up @@ -283,6 +284,8 @@ private String format(Object o) {
return format(((Integer) o).longValue());
} else if (o instanceof Long) {
return format(((Long) o).longValue());
} else if (o instanceof Boolean) {
return ((Boolean) o)? "1": "0";
}
return null;
}
Expand Down