public class StatsDAggregator extends Object
| Modifier and Type | Field and Description |
|---|---|
protected ArrayList<Map<Message,Message>> |
aggregateMetrics |
protected String |
AGGREGATOR_THREAD_NAME |
static int |
DEFAULT_FLUSH_INTERVAL |
static int |
DEFAULT_SHARDS |
protected long |
flushInterval |
protected Timer |
scheduler |
protected int |
shardGranularity |
| Constructor and Description |
|---|
StatsDAggregator(StatsDProcessor processor,
int shards,
long flushInterval)
StatsDAggregtor constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
aggregateMessage(Message message)
Aggregate a message if possible.
|
protected void |
flush() |
long |
getFlushInterval() |
int |
getShardGranularity() |
void |
start()
Start the aggregator flushing scheduler.
|
void |
stop()
Stop the aggregator flushing scheduler.
|
public static int DEFAULT_FLUSH_INTERVAL
public static int DEFAULT_SHARDS
protected final String AGGREGATOR_THREAD_NAME
protected final int shardGranularity
protected final long flushInterval
protected Timer scheduler
public StatsDAggregator(StatsDProcessor processor, int shards, long flushInterval)
processor - the message processor, aggregated messages will be queued in the high
priority queue.shards - number of shards for the aggregation map.flushInterval - flush interval in miliseconds, 0 disables message aggregation.public void start()
public void stop()
public boolean aggregateMessage(Message message)
message - the dogstatsd Message we wish to aggregate.public final long getFlushInterval()
public final int getShardGranularity()
protected void flush()
Copyright © 2025. All rights reserved.