-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved all monitoring stuff into single package
- Loading branch information
1 parent
c7810f7
commit cddd796
Showing
11 changed files
with
55 additions
and
22 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...utterlyidle/statsd/BufferedMessenger.java → ...rlyidle/monitoring/BufferedMessenger.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../utterlyidle/statsd/ChannelMessenger.java → ...erlyidle/monitoring/ChannelMessenger.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/com/googlecode/utterlyidle/monitoring/JsonLinesClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.googlecode.utterlyidle.monitoring; | ||
|
||
import com.googlecode.totallylazy.json.Json; | ||
|
||
import java.io.Closeable; | ||
import java.io.IOException; | ||
import java.net.SocketAddress; | ||
import java.nio.channels.SocketChannel; | ||
|
||
public interface JsonLinesClient extends Closeable { | ||
void send(Object value) throws IOException; | ||
|
||
@Override | ||
default void close() throws IOException { | ||
} | ||
|
||
static JsonLinesClient jsonSender(SocketAddress socketAddress) throws IOException { | ||
TcpMessenger messenger = new TcpMessenger(SocketChannel.open(socketAddress)); | ||
return new JsonLinesClient() { | ||
@Override | ||
public void send(final Object value) throws IOException { | ||
messenger.message(Json.json(value)); | ||
} | ||
|
||
@Override | ||
public void close() throws IOException { | ||
messenger.close(); | ||
} | ||
}; | ||
} | ||
|
||
static JsonLinesClient noOp() { | ||
return value -> { | ||
}; | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...glecode/utterlyidle/statsd/Messenger.java → ...ode/utterlyidle/monitoring/Messenger.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...googlecode/utterlyidle/gelf/Severity.java → ...code/utterlyidle/monitoring/Severity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
...code/utterlyidle/statsd/TcpMessenger.java → .../utterlyidle/monitoring/TcpMessenger.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...code/utterlyidle/statsd/UdpMessenger.java → .../utterlyidle/monitoring/UdpMessenger.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters