Class ServerStatusCollector

java.lang.Object
io.github.theword.queqiao.core.protocol.handler.status.ServerStatusCollector

public final class ServerStatusCollector extends Object
服务器状态采集工具。
  • Method Details

    • startRefreshScheduler

      public static void startRefreshScheduler(int intervalSeconds, org.slf4j.Logger logger)
      启动状态快照定时采集。Runtime 启动完成后调用;重复调用只重设现有任务。
    • updateRefreshInterval

      public static void updateRefreshInterval(int intervalSeconds)
      更新间隔;未变化时不打断当前采集周期。
    • stopRefreshScheduler

      public static void stopRefreshScheduler()
      关闭 Runtime 持有的状态采集任务与线程。
    • initPingTarget

      public static void initPingTarget(org.slf4j.Logger logger)
    • collectStatusSnapshot

      public static Map<String,Object> collectStatusSnapshot()
      返回最近一次定时采集的完整状态快照。

      Runtime 正常运行时,此方法不执行网络 Ping 或系统指标采集。只有首次采集尚未完成时, 调用方才等待共享的首轮结果,等待有明确上限。Runtime 未启动时保留同步回退,便于兼容 直接使用该静态门面的既有调用。

      Returns:
      状态快照 Map