Class FileExportStats

java.lang.Object
ai.attackframework.tools.burp.utils.FileExportStats

public final class FileExportStats extends Object
Thread-safe session stats for file-based exports.

These counters mirror the high-level OpenSearch export metrics used by StatsPanel, but track only documents and bytes that were actually written to file sinks.

  • Method Details

    • getIndexKeys

      public static List<String> getIndexKeys()
      Returns the tracked short index keys used by file-export stats.
    • getTrafficToolTypeKeys

      public static List<String> getTrafficToolTypeKeys()
      Returns the tracked traffic tool-type keys used by file-export source stats.
    • recordSuccess

      public static void recordSuccess(String indexKey, long count)
      Records one or more successful file-export document writes for an index key.
    • recordFailure

      public static void recordFailure(String indexKey, long count)
      Records one or more failed file-export write attempts for an index key.
    • recordExportedBytes

      public static void recordExportedBytes(String indexKey, long bytes)
      Records successfully written file-export bytes for an index key.
    • recordLastWriteDurationMs

      public static void recordLastWriteDurationMs(String indexKey, long durationMs)
      Records the wall-clock duration of the latest successful file write for an index key.
    • recordLastError

      public static void recordLastError(String indexKey, String message)
      Stores the latest file-export error for an index key, truncating overly long messages.
    • getSuccessCount

      public static long getSuccessCount(String indexKey)
      Returns the successful file-export document count for an index key.
    • getFailureCount

      public static long getFailureCount(String indexKey)
      Returns the failed file-export document count for an index key.
    • getExportedBytes

      public static long getExportedBytes(String indexKey)
      Returns the successful file-export bytes recorded for an index key.
    • getLastWriteDurationMs

      public static long getLastWriteDurationMs(String indexKey)
      Returns the latest successful file-write duration for an index key, or -1.
    • getLastError

      public static String getLastError(String indexKey)
      Returns the latest file-export error for an index key, or null.
    • getTotalSuccessCount

      public static long getTotalSuccessCount()
      Returns the total successful file-export document count across all tracked indexes.
    • getTotalFailureCount

      public static long getTotalFailureCount()
      Returns the total failed file-export document count across all tracked indexes.
    • getTotalExportedBytes

      public static long getTotalExportedBytes()
      Returns the total successful file-export bytes across all tracked indexes.
    • recordTrafficSourceSuccess

      public static void recordTrafficSourceSuccess(String sourceKey, long count)
      Records one or more successful traffic document writes for a file-export source key.
    • recordTrafficSourceFailure

      public static void recordTrafficSourceFailure(String sourceKey, long count)
      Records one or more failed traffic document writes for a file-export source key.
    • getTrafficSourceSuccessCount

      public static long getTrafficSourceSuccessCount(String sourceKey)
      Returns the successful file-export count for a traffic source key.
    • getTrafficSourceFailureCount

      public static long getTrafficSourceFailureCount(String sourceKey)
      Returns the failed file-export count for a traffic source key.
    • recordTrafficToolTypeCaptured

      public static void recordTrafficToolTypeCaptured(String toolTypeKey, long count)
      Records captured traffic tool-type counts for file-exported traffic documents.
    • getTrafficToolTypeCapturedCount

      public static long getTrafficToolTypeCapturedCount(String toolTypeKey)
      Returns the captured file-export traffic count for one tool type.
    • resetForTests

      public static void resetForTests()
      Resets all file-export stats. Intended for tests and process-local lifecycle cleanup.