Package com.wavefront.agent.handlers
Class HistogramAccumulationHandlerImpl
- java.lang.Object
-
- com.wavefront.agent.handlers.HistogramAccumulationHandlerImpl
-
- All Implemented Interfaces:
ReportableEntityHandler<wavefront.report.ReportPoint>
public class HistogramAccumulationHandlerImpl extends Object
A ReportPointHandler that ships parsed points to a histogram accumulator instead of forwarding them to SenderTask.- Author:
- [email protected]
-
-
Constructor Summary
Constructors Constructor Description HistogramAccumulationHandlerImpl(String handle, Accumulator digests, int blockedItemsPerBatch, Utils.Granularity granularity, Supplier<com.wavefront.api.agent.ValidationConfiguration> validationConfig, boolean isHistogramInput, Logger blockedItemLogger)
Creates a new instance
-
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.protected com.yammer.metrics.core.Counter
getReceivedCounter()
protected long
getReceivedFiveMinuteCount()
protected long
getReceivedOneMinuteCount()
protected SenderTask
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)
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
report(T item, Object messageObject, Function<Object,String> messageSerializer)
Validate and accept the input object.protected void
reportInternal(wavefront.report.ReportPoint point)
-
-
-
Constructor Detail
-
HistogramAccumulationHandlerImpl
public HistogramAccumulationHandlerImpl(String handle, Accumulator digests, int blockedItemsPerBatch, @Nullable Utils.Granularity granularity, @Nullable Supplier<com.wavefront.api.agent.ValidationConfiguration> validationConfig, boolean isHistogramInput, Logger blockedItemLogger)
Creates a new instance- Parameters:
handle
- handle/port numberdigests
- accumulator for storing digestsblockedItemsPerBatch
- controls sample rate of how many blocked points are written into the main log file.granularity
- granularity levelvalidationConfig
- Supplier for the ValidationConfigurationisHistogramInput
- Whether expected input data for this handler is histograms.
-
-
Method Detail
-
reportInternal
protected void reportInternal(wavefront.report.ReportPoint point)
-
reject
public void reject(T item)
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>
- Parameters:
item
- object to reject.
-
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>
- Parameters:
item
- object to reject.message
- more user-friendly message to write to the main log.
-
reject
public void reject(@NotNull 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>
- 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>
- 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>
- 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>
- Parameters:
item
- object to accept.
-
report
public void report(T item, @Nullable Object messageObject, @NotNull Function<Object,String> messageSerializer)
Description copied from interface:ReportableEntityHandler
Validate and accept the input object. If validation fails, convert messageObject to string and write to log.- Specified by:
report
in interfaceReportableEntityHandler<T>
- Parameters:
item
- object to accept.messageObject
- object to write to log if validation fails.messageSerializer
- function to convert messageObject to string.
-
getReceivedCounter
protected com.yammer.metrics.core.Counter getReceivedCounter()
-
getReceivedOneMinuteCount
protected long getReceivedOneMinuteCount()
-
getReceivedFiveMinuteCount
protected long getReceivedFiveMinuteCount()
-
getTask
protected SenderTask getTask()
-
printStats
protected void printStats()
-
printTotal
protected void printTotal()
-
-