Package org.microproxy.stats
Class StatsdSink.Builder
java.lang.Object
org.microproxy.stats.StatsdSink.Builder
- Enclosing class:
StatsdSink
Settings for a
StatsdSink.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Opens the socket.dogStatsd(boolean dogStatsd) Whether to send DogStatsD tags (|#name:value,...) with the tag-extracted names (default false: plain statsd, flat names).How often to send (default 5 seconds).maxPacketSize(int bytes) The largest datagram to send (default 1432 bytes, which fits an Ethernet frame).
-
Method Details
-
interval
How often to send (default 5 seconds).- Parameters:
interval- the flush interval, positive- Returns:
- this builder
- Throws:
IllegalArgumentException- if it is not positive
-
dogStatsd
Whether to send DogStatsD tags (|#name:value,...) with the tag-extracted names (default false: plain statsd, flat names).- Parameters:
dogStatsd- whether to send tags- Returns:
- this builder
-
maxPacketSize
The largest datagram to send (default 1432 bytes, which fits an Ethernet frame).- Parameters:
bytes- the most bytes per datagram, from 64 to 65507- Returns:
- this builder
- Throws:
IllegalArgumentException- if it is out of range
-
build
Opens the socket. CallStatsdSink.start()to flush every interval.- Returns:
- the sink
- Throws:
IOException- if the UDP socket cannot be opened
-