Package dev.dokimos.core
Interface Reporter
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
DokimosServerReporter,NoOpReporter
Interface for reporting experiment results to an external system.
Implementations can report results to a server, file, or any other destination. The experiment runner calls these methods at appropriate points during execution.
Implementations should be thread-safe if used concurrently.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Flushes pending items and releases resources.voidcompleteRun(RunHandle handle, RunStatus status) Marks a run as complete.voidflush()Blocks until all pending items are sent.voidreportItem(RunHandle handle, ItemResult result) Reports a single evaluated item.Starts a new experiment run.
-
Method Details
-
startRun
Starts a new experiment run.- Parameters:
experimentName- the name of the experimentmetadata- configuration metadata for the run- Returns:
- a handle identifying this run
-
reportItem
Reports a single evaluated item.This is called after each item completes evaluation, not batched at the end.
- Parameters:
handle- the run handle fromstartRun(java.lang.String, java.util.Map<java.lang.String, java.lang.Object>)result- the evaluated item result
-
completeRun
Marks a run as complete.- Parameters:
handle- the run handle fromstartRun(java.lang.String, java.util.Map<java.lang.String, java.lang.Object>)status- the final status of the run
-
flush
void flush()Blocks until all pending items are sent.This is important for async implementations to ensure all data is transmitted before the experiment returns.
-
close
void close()Flushes pending items and releases resources.- Specified by:
closein interfaceAutoCloseable
-