类 MailboxStatistics

java.lang.Object
com.darra.ethercat.abstractions.MailboxStatistics

public class MailboxStatistics extends Object
邮箱统计快照 (对齐 C# MailboxStatistics).
Mailbox statistics snapshot (aligned with C# MailboxStatistics).

字段全部为 final, 创建后不可变. All fields are final (immutable snapshot).

  • 字段详细资料

    • totalSent

      public final long totalSent
      累计发送事务数 / total sent transactions
    • totalReceived

      public final long totalReceived
      累计收到响应数 (含错误帧) / total received responses (including error frames)
    • totalTimeout

      public final long totalTimeout
      累计超时次数 / total timeouts
    • totalMailboxError

      public final long totalMailboxError
      累计收到邮箱错误帧数 (MBX ERROR / SDO Abort 等) / total mailbox error frames
    • totalProtocolError

      public final long totalProtocolError
      累计协议错误次数 (类型 / counter / WKC 不匹配) / total protocol errors
    • totalCancelled

      public final long totalCancelled
      累计被取消的事务数 / total cancelled transactions
    • lastErrorCode

      public final long lastErrorCode
      最近一次错误码 (协议相关, 0 表示无) / last protocol-level error code (0 = none)
    • lastErrorTime

      public final Instant lastErrorTime
      最近一次错误时刻 (UTC); 无错误则为 null / last error time (UTC), null if none
    • averageLatencyUs

      public final double averageLatencyUs
      平均事务延迟 (微秒) / average transaction latency in microseconds
  • 构造器详细资料

    • MailboxStatistics

      public MailboxStatistics(long sent, long recv, long timeout, long mbxErr, long protoErr, long cancelled, long lastErr, Instant lastErrTime, double avgLatency)
      构造 / Construct.
      参数:
      sent - 累计发送 / total sent
      recv - 累计接收 / total received
      timeout - 累计超时 / total timeout
      mbxErr - 累计邮箱错误帧 / total mailbox error frames
      protoErr - 累计协议错误 / total protocol errors
      cancelled - 累计取消 / total cancelled
      lastErr - 最近错误码 / last error code
      lastErrTime - 最近错误时刻 (null 表示无) / last error time (null = none)
      avgLatency - 平均延迟 (微秒) / average latency (microseconds)
  • 方法详细资料

    • empty

      public static MailboxStatistics empty()
      空快照 (全 0) / empty snapshot (all zero).
    • fetch

      public static MailboxStatistics fetch(short masterIndex, short slaveIndex, byte protocolType)
      经 native EcxMbxGetStats 拉取 per-slave / per-protocol 邮箱统计快照.

      [审计补齐 roundSDKSAN2] 此前 6 个协议类的 getStatistics() 一律返回 empty() 占位; 现 DarraCore 已绑定 EcxMbxGetStats, 与 C# CoE.Statistics 走 DLL.EcxMbxGetStats 同源. 调用失败 / native 未就绪时 降级返回 empty().

      参数:
      protocolType - MBX 协议类型 (CoE=0x03, FoE=0x04, SoE=0x05, AoE=0x01, EoE=0x02, VoE=0x0F, FSoE=0x08; 0=全部累加)
      返回:
      统计快照; 失败返回 empty()
    • reset

      public static void reset(short masterIndex, short slaveIndex, byte protocolType)
      经 native EcxMbxResetStats 重置 per-slave / per-protocol 邮箱统计.
      参数:
      protocolType - 协议类型; 0=清空所有协议
    • getTotalSent

      public long getTotalSent()
      返回:
      累计发送 / total sent
    • getTotalReceived

      public long getTotalReceived()
      返回:
      累计接收 / total received
    • getTotalTimeout

      public long getTotalTimeout()
      返回:
      累计超时 / total timeout
    • getTotalMailboxError

      public long getTotalMailboxError()
      返回:
      累计邮箱错误 / total mailbox error
    • getTotalProtocolError

      public long getTotalProtocolError()
      返回:
      累计协议错误 / total protocol error
    • getTotalCancelled

      public long getTotalCancelled()
      返回:
      累计取消 / total cancelled
    • getLastErrorCode

      public long getLastErrorCode()
      返回:
      最近错误码 / last error code
    • getLastErrorTime

      public Instant getLastErrorTime()
      返回:
      最近错误时刻 / last error time
    • getAverageLatencyUs

      public double getAverageLatencyUs()
      返回:
      平均延迟 (微秒) / average latency in microseconds