Package com.wavefront.agent.handlers
Class DeltaCounterAccumulationHandlerImpl
- java.lang.Object
-
- com.wavefront.agent.handlers.DeltaCounterAccumulationHandlerImpl
-
- All Implemented Interfaces:
ReportableEntityHandler<wavefront.report.ReportPoint,String>
public class DeltaCounterAccumulationHandlerImpl extends Object
Handler that processes incoming DeltaCounter objects, aggregates them and hands it over to one of theSenderTask
threads according to deltaCountersAggregationIntervalSeconds or before cache expires.- Author:
- [email protected]
-
-
Field Summary
Fields Modifier and Type Field Description protected static com.yammer.metrics.core.MetricsRegistry
LOCAL_REGISTRY
-
Constructor Summary
Constructors Constructor Description DeltaCounterAccumulationHandlerImpl(HandlerKey handlerKey, int blockedItemsPerBatch, Collection<SenderTask<String>> senderTasks, com.wavefront.api.agent.ValidationConfiguration validationConfig, long aggregationIntervalSeconds, Consumer<Long> receivedRateSink, Logger blockedItemLogger, Logger validItemsLogger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
block(T item)
Handle the input object as blocked.void
block(T item, String message)
Handle the input object as blocked.void
flushDeltaCounters()
protected com.yammer.metrics.core.Counter
getReceivedCounter()
protected SenderTask<U>
getTask()
protected void
printStats()
protected void
printTotal()
void
reject(String line, String message)
Reject the input object as invalid, i.e.void
reject(T item, String message)
Reject the input object as invalid, i.e.void
report(T item)
Validate and accept the input object.void
shutdown()
Gracefully shutdown the pipeline.
-
-
-
Constructor Detail
-
DeltaCounterAccumulationHandlerImpl
public DeltaCounterAccumulationHandlerImpl(HandlerKey handlerKey, int blockedItemsPerBatch, @Nullable Collection<SenderTask<String>> senderTasks, @Nonnull com.wavefront.api.agent.ValidationConfiguration validationConfig, long aggregationIntervalSeconds, @Nullable Consumer<Long> receivedRateSink, @Nullable Logger blockedItemLogger, @Nullable Logger validItemsLogger)
- Parameters:
handlerKey
- metrics pipeline key.blockedItemsPerBatch
- controls sample rate of how many blocked points are written into the main log file.senderTasks
- sender tasks.validationConfig
- validation configuration.aggregationIntervalSeconds
- aggregation interval for delta counters.receivedRateSink
- where to report received rate.blockedItemLogger
- logger for blocked items.validItemsLogger
- logger for valid items.
-
-
Method Detail
-
flushDeltaCounters
public void flushDeltaCounters()
-
shutdown
public void shutdown()
Description copied from interface:ReportableEntityHandler
Gracefully shutdown the pipeline.- Specified by:
shutdown
in interfaceReportableEntityHandler<wavefront.report.ReportPoint,String>
-
reject
public void reject(@Nullable T item, @Nullable String message)
Description copied from interface:ReportableEntityHandler
Reject the input object as invalid, i.e. rejected based on criteria defined by Wavefront.- Specified by:
reject
in interfaceReportableEntityHandler<T,U>
- Parameters:
item
- object to reject.message
- more user-friendly message to write to the main log.
-
reject
public void reject(@Nonnull String line, @Nullable String message)
Description copied from interface:ReportableEntityHandler
Reject the input object as invalid, i.e. rejected based on criteria defined by Wavefront.- Specified by:
reject
in interfaceReportableEntityHandler<T,U>
- Parameters:
line
- string to reject and to write to RawBlockedPointsLog.message
- more user-friendly message to write to the main log.
-
block
public void block(T item)
Description copied from interface:ReportableEntityHandler
Handle the input object as blocked. Blocked objects are otherwise valid objects that are rejected based on user-defined criteria.- Specified by:
block
in interfaceReportableEntityHandler<T,U>
- Parameters:
item
- object to block.
-
block
public void block(@Nullable T item, @Nullable String message)
Description copied from interface:ReportableEntityHandler
Handle the input object as blocked. Blocked objects are otherwise valid objects that are rejected based on user-defined criteria.- Specified by:
block
in interfaceReportableEntityHandler<T,U>
- Parameters:
item
- object to block.message
- message to write to the main log.
-
report
public void report(T item)
Description copied from interface:ReportableEntityHandler
Validate and accept the input object.- Specified by:
report
in interfaceReportableEntityHandler<T,U>
- Parameters:
item
- object to accept.
-
getReceivedCounter
protected com.yammer.metrics.core.Counter getReceivedCounter()
-
getTask
protected SenderTask<U> getTask()
-
printStats
protected void printStats()
-
printTotal
protected void printTotal()
-
-