Files
Ayay/SHH.CameraSdk/Core/Telemetry/CameraTelemetryInfo.cs
2025-12-26 13:11:58 +08:00

59 lines
2.5 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>
/// 相机实时遥测数据快照
/// 功能:封装单台相机的实时运行状态、性能指标与健康度信息,用于监控面板展示、运维告警与数据分析
/// 特性数据为瞬时快照通常定期如1秒/次)更新,反映相机当前运行状况
/// </summary>
public class CameraTelemetryInfo
{
#region --- (Device Core Identification) ---
/// <summary> 设备唯一业务标识对应数据库ID或配置中的设备ID </summary>
public long DeviceId { get; set; }
/// <summary> 设备显示名称(如“北大门-枪机01”用于UI展示 </summary>
public string Name { get; set; } = string.Empty;
/// <summary> 设备IP地址用于网络连通性校验与远程访问 </summary>
public string IpAddress { get; set; } = string.Empty;
#endregion
#region --- (Device Operation Status) ---
/// <summary> 相机当前运行状态(字符串形式,对应 VideoSourceStatus 枚举值,如 "Playing"/"Faulted"/"Connecting" </summary>
public string Status { get; set; } = string.Empty;
/// <summary> 设备物理连接状态(通过 Ping/TCP 探测判定true=在线false=离线) </summary>
public bool IsOnline { get; set; }
/// <summary> 最后一次报错信息(无错误时为 null用于快速定位故障原因 </summary>
public string? LastErrorMessage { get; set; }
#endregion
#region --- (Performance Metrics) ---
/// <summary> 实时帧率单位fps反映相机取流与处理的实时速度 </summary>
public double Fps { get; set; }
/// <summary> 累计接收帧数(相机启动后接收的总帧数,用于统计数据完整性) </summary>
public long TotalFrames { get; set; }
/// <summary> 实时码率 (Mbps) </summary>
public double Bitrate { get; set; }
#endregion
#region --- (Health & Statistics) ---
/// <summary> 设备健康度评分0-100分分数越高健康状态越好 </summary>
/// <remarks> 计算逻辑结合是否断线、实时FPS是否在正常范围、是否有报错等因素综合判定 </remarks>
public int HealthScore { get; set; }
/// <summary> 遥测数据统计时间戳(记录当前快照的生成时间,默认当前时间) </summary>
public DateTime Timestamp { get; set; } = DateTime.Now;
#endregion
}