Package com.gengoai.hermes.corpus
Interface ProgressLogger
-
- All Superinterfaces:
Serializable
public interface ProgressLogger extends Serializable
Defines a logger that keeps track of the number of documents and words processed and reports processing statistics on a given interval.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static ProgressLogger
create(@NonNull DocumentCollection owner, @NonNull String operation)
static ProgressLogger
create(@NonNull StreamingContext streamingContext, @NonNull Logger logger, @NonNull Level level, long interval, @NonNull String operationName)
Creates a progress logger for the given streaming context.double
documentsPerSecond()
long
documentsProcessed()
void
report()
Reports processing statistics.void
start()
Starts the processing timervoid
stop(long wordsProcessed)
Stops the current processing timerdouble
wordsPerSecond()
long
wordsProcessed()
-
-
-
Method Detail
-
create
static ProgressLogger create(@NonNull @NonNull DocumentCollection owner, @NonNull @NonNull String operation)
-
create
static ProgressLogger create(@NonNull @NonNull StreamingContext streamingContext, @NonNull @NonNull Logger logger, @NonNull @NonNull Level level, long interval, @NonNull @NonNull String operationName)
Creates a progress logger for the given streaming context.- Parameters:
streamingContext
- the streaming contextlogger
- the logger to use to log messageslevel
- the level to log atinterval
- the interval between number of documents to process for reporting.- Returns:
- the progress logger
-
documentsPerSecond
double documentsPerSecond()
- Returns:
- the number of documents per second processed.
-
documentsProcessed
long documentsProcessed()
- Returns:
- the number of documents processed.
-
report
void report()
Reports processing statistics.
-
start
void start()
Starts the processing timer
-
stop
void stop(long wordsProcessed)
Stops the current processing timer- Parameters:
wordsProcessed
- the number of words processed
-
wordsPerSecond
double wordsPerSecond()
- Returns:
- the number of words per second processed.
-
wordsProcessed
long wordsProcessed()
- Returns:
- the number of words processed
-
-