Files
Ayay/SHH.CameraSdk/Core/Telemetry/CameraHealthReport.cs

50 lines
2.1 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
namespace SHH.CameraSdk;
/// <summary>
/// 相机健康度报告
/// 功能:封装相机的详细运行健康数据,包含状态、性能、故障统计等信息
/// 用途:用于运维分析、故障排查、设备健康度评估,提供比遥测快照更细致的健康指标
/// </summary>
public class CameraHealthReport
{
#region --- (Device Core Identification) ---
/// <summary> 设备唯一业务标识对应数据库ID或配置中的设备ID </summary>
public long DeviceId { get; set; }
/// <summary> 设备IP地址用于定位具体设备 </summary>
public string Ip { get; set; } = string.Empty;
#endregion
#region --- (Device Operation Status) ---
/// <summary> 设备当前运行状态(字符串形式,对应 VideoSourceStatus 枚举值,如 "Streaming"/"Faulted"/"Reconnecting" </summary>
public string Status { get; set; } = string.Empty;
/// <summary> 最后一次错误信息(无错误时建议设为空字符串,记录设备最近一次故障原因) </summary>
public string LastError { get; set; } = string.Empty;
#endregion
#region --- (Performance & Latency Metrics) ---
/// <summary> 实时帧率单位fps反映相机实际输出的有效帧率 </summary>
/// <remarks> 统计逻辑:需在 RaiseFrameReceived 事件中增加计数器,按时间窗口计算实时值 </remarks>
public double RealFps { get; set; }
/// <summary> 推流延迟(单位:毫秒,记录从相机推流到接收端成功接收的总延迟) </summary>
public double LatencyMs { get; set; }
#endregion
#region --- (Fault & Recovery Statistics) ---
/// <summary> 丢帧计数(因渲染过慢、缓冲区溢出等原因导致的丢弃帧数累计值) </summary>
public long DropFrames { get; set; }
/// <summary> 重连次数(哨兵机制触发的自动重连累计次数,反映设备网络稳定性) </summary>
public int ReconnectCount { get; set; }
#endregion
}