https://github.com/jcustenborder/netty-codec-statsd
Netty decoder for StatsD
https://github.com/jcustenborder/netty-codec-statsd
netty statsd
Last synced: about 2 months ago
JSON representation
Netty decoder for StatsD
- Host: GitHub
- URL: https://github.com/jcustenborder/netty-codec-statsd
- Owner: jcustenborder
- License: apache-2.0
- Created: 2017-01-17T17:52:27.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-02-06T01:26:22.000Z (over 7 years ago)
- Last Synced: 2025-12-26T13:44:21.760Z (6 months ago)
- Topics: netty, statsd
- Language: Java
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Introduction
This project is an implementation of the StatsD protocol for [Netty](http://netty.io/). Currently there is only support for
the UDP protocol. More than one entry can be sent by separating each entry with a new line.
## Usage
```
b = new Bootstrap();
b.group(bossGroup)
.channel(NioDatagramChannel.class)
.handler(new ChannelInitializer() {
@Override
protected void initChannel(DatagramChannel datagramChannel) throws Exception {
ChannelPipeline channelPipeline = datagramChannel.pipeline();
channelPipeline.addLast(
new LoggingHandler("StatsD", LogLevel.TRACE),
new StatsDRequestDecoder(),
new StatsDRequestHandler(config, records, time)
);
}
});
```
Each metric that is found will be passed along in the pipeline.
```
class StatsDRequestHandler extends SimpleChannelInboundHandler {
@Override
protected void channelRead0(ChannelHandlerContext channelHandlerContext, Metric metric) throws Exception {
}
}
```