T - the type of the object associated with the log message.public class RateLimitingLogger<T> extends Object
| Constructor and Description |
|---|
RateLimitingLogger(int logSamplePeriodMs,
int maxObjects,
Logger logger)
Constructs a configured RateLimitingLoggerInstance.
|
| Modifier and Type | Method and Description |
|---|---|
Logger |
getInternalLogger() |
long |
getLimitedMessageCount() |
void |
log(T object,
Level level,
String string)
Logs the message, if one has not already been logged for the object
in the current time interval.
|
public RateLimitingLogger(int logSamplePeriodMs,
int maxObjects,
Logger logger)
logSamplePeriodMs - used to compute the max rate of
1 message/logSamplePeriodMsmaxObjects - the max number of MRU objects to tracklogger - the rate limited messages are written to this loggerpublic long getLimitedMessageCount()
public void log(T object, Level level, String string)
object - the object associated with the log messagelevel - the level to be used for loggingstring - the log message stringpublic Logger getInternalLogger()
Copyright © 2024. All rights reserved.