Class SnapshotSummary
Reporters such as ProxyHistoryIndexReporter and SitemapIndexReporter run
bounded, single-pass exports at Start. This helper captures counter deltas across the run
and emits a single INFO-level panel line with attempted, file, and OpenSearch
outcomes. The file={...}; openSearch={...} body shares the substructure with the
Repeater Tabs startup completion summary so operators can visually align per-source
totals across reporters; the surrounding prefix and suffix differ per reporter.
Two counter sources are supported via forRoute(TrafficRouteBucket.Route) and
forIndexKey(String): traffic reporters use the per-route bucket counters, while
non-traffic reporters (Sitemap, Findings, etc.) use the index-key totals exposed by
ExportStats / FileExportStats. Both flavors share identical body output.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBaseline counters for a counter source captured before a one-shot run. -
Method Summary
Modifier and TypeMethodDescriptionstatic SnapshotSummary.BaselineforIndexKey(String indexKey) Snapshots the current file and OpenSearch counters for a non-trafficindexKey.static StringformatCompletionBody(SnapshotSummary.Baseline baseline, boolean openSearchActive, boolean fileActive) Builds thefile={...}; openSearch={...}body fragment that reporters can compose into their own completion log lines.static SnapshotSummary.BaselineforRoute(TrafficRouteBucket.Route route) Snapshots the current file and OpenSearch counters for a traffic route.static voidlogInfo(String prefix, SnapshotSummary.Baseline baseline, int attempted, long durationMs, boolean openSearchActive, boolean fileActive) Logs a completion summary comparing current counters tobaseline.
-
Method Details
-
forRoute
Snapshots the current file and OpenSearch counters for a traffic route. Use before starting a run and pair withlogInfo(java.lang.String, ai.attackframework.tools.burp.sinks.SnapshotSummary.Baseline, int, long, boolean, boolean)after the run to compute deltas.- Parameters:
route- route whose counters should be tracked;nullreturns an empty snapshot- Returns:
- baseline snapshot; never
null
-
forIndexKey
Snapshots the current file and OpenSearch counters for a non-trafficindexKey.- Parameters:
indexKey- logical index key (for example"sitemap","findings");nullor blank returns an empty snapshot- Returns:
- baseline snapshot; never
null
-
logInfo
public static void logInfo(String prefix, SnapshotSummary.Baseline baseline, int attempted, long durationMs, boolean openSearchActive, boolean fileActive) Logs a completion summary comparing current counters tobaseline.- Parameters:
prefix- logger bracket prefix (for example"ProxyHistory","Sitemap")baseline- snapshot captured before the run startedattempted- total documents attempted in the run (including those that produced no doc)durationMs- wall-clock run duration in millisecondsopenSearchActive- whether the OpenSearch sink was active for the runfileActive- whether any file sink was active for the run
-
formatCompletionBody
public static String formatCompletionBody(SnapshotSummary.Baseline baseline, boolean openSearchActive, boolean fileActive) Builds thefile={...}; openSearch={...}body fragment that reporters can compose into their own completion log lines.Each section is included only when the corresponding sink was active for the run. When both are inactive the method returns an empty string. Reporters are responsible for prepending/appending any surrounding prefix, suffix, or separators.
- Parameters:
baseline- snapshot captured before the run;nullyields zeroed deltasopenSearchActive- whether the OpenSearch sink was active for the runfileActive- whether any file sink was active for the run- Returns:
- fragment such as
"file={success=2, failure=0}; openSearch={success=2, failure=0}"; nevernull
-