using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MrWu.Basic;

namespace Server
{
    /// <summary>
    /// 服务器信息
    /// </summary>
    public class ServerInfo
    {
        /// <summary>
        /// 模块id
        /// </summary>
        public int moduleId;

        /// <summary>
        /// 模块编号
        /// </summary>
        public int nodenum;

        /// <summary>
        /// 服务器名称
        /// </summary>
        public string serverName;

        /// <summary>
        /// 启动时间
        /// </summary>
        public DateTime startTime;
        
        /// <summary>
        /// 处理包数量
        /// </summary>
        public long dopackCnt;

        /// <summary>
        /// 帧率
        /// </summary>
        public int fps;

        /// <summary>
        /// 最低帧率
        /// </summary>
        public int minfps;
        
        /// <summary>
        /// 最低运行时间
        /// </summary>
        public double maxRuntime;

        /// <summary>
        /// 链接数
        /// </summary>
        public int ConnectCnt;

        /// <summary>
        /// 绑定数
        /// </summary>
        public int BindConnectCnt;
        
        /// <summary>
        /// 
        /// </summary>
        public ServerInfo() {

        }


        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();
            int weight = -15;
            sb.AppendLine(BaseFun.Align("moduleId:", moduleId, weight));
            sb.AppendLine(BaseFun.Align("nodenum:", nodenum, weight));
            sb.AppendLine(BaseFun.Align("服务器名称:", serverName, weight));
            sb.AppendLine(BaseFun.Align("启动时间:", startTime, weight));
            sb.AppendLine(BaseFun.Align("收包数量:",dopackCnt,weight));
            sb.AppendLine(BaseFun.Align("帧率:",fps,weight));
            sb.AppendLine(BaseFun.Align("最低帧率:",minfps,weight));
            sb.AppendLine(BaseFun.Align("连接数:", ConnectCnt, weight));
            sb.AppendLine(BaseFun.Align("绑定数:", BindConnectCnt, weight));
            sb.AppendLine(BaseFun.Align("最长运行时间:", maxRuntime, weight));
            return sb.ToString();
        }

    }
}
