Class ToolIndexStatsReporter

java.lang.Object
ai.attackframework.tools.burp.sinks.ToolIndexStatsReporter

public final class ToolIndexStatsReporter extends Object
Periodically pushes a stats snapshot document to the tool index (IndexNaming.INDEX_PREFIX) for resource and export metrics in OpenSearch.

Started when export startup reaches the tool-stats phase; runs on a daemon thread. Only pushes when export is running and RuntimeConfig.openSearchUrl() is set. Fire-and-forget; failures are not pushed back to the tool index to avoid feedback loops.

Set ENABLED to false to disable the reporter (e.g. to test whether periodic OpenSearch pushes contribute to memory growth).

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final boolean
    When false, no scheduler is started and no documents are pushed.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Pushes one stats snapshot immediately so the tool index can reflect the current runtime state without waiting for the next interval.
    static void
    Starts the periodic stats reporter if not already running.
    static void
    Stops the periodic stats scheduler.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ENABLED

      public static final boolean ENABLED
      When false, no scheduler is started and no documents are pushed.
      See Also:
  • Method Details

    • pushSnapshotNow

      public static void pushSnapshotNow()
      Pushes one stats snapshot immediately so the tool index can reflect the current runtime state without waiting for the next interval.

      Safe to call from any thread. No-op if export is not running or no sink is enabled.

    • start

      public static void start()
      Starts the periodic stats reporter if not already running.

      Safe to call from any thread. Uses a single daemon scheduler. No-op if ENABLED is false.

    • stop

      public static void stop()
      Stops the periodic stats scheduler.

      Safe to call from any thread. The next start() call creates a fresh scheduler.