节点表新增ProductCode,产品编码,用于区分不同类型节点
智能大石头 authored at 2022-02-01 23:23:59
24.06 KiB
Stardust
<?xml version="1.0" encoding="utf-8"?>
<Tables xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:schemaLocation="http://www.newlifex.com http://www.newlifex.com/Model2020.xsd" NameSpace="Stardust.Data.Nodes" ConnName="Node" Output="" BaseClass="Entity" xmlns="http://www.newlifex.com/Model2020.xsd">
  <Table Name="Node" Description="节点">
    <Columns>
      <Column Name="ID" DataType="Int32" Identity="True" PrimaryKey="True" Description="编号" />
      <Column Name="Name" DataType="String" Master="True" Description="名称" />
      <Column Name="Code" DataType="String" Description="编码。NodeKey" />
      <Column Name="Secret" DataType="String" Description="密钥。NodeSecret" />
      <Column Name="Enable" DataType="Boolean" Description="启用" />
      <Column Name="ProductCode" DataType="String" Description="产品。产品编码,用于区分不同类型节点" />
      <Column Name="Category" DataType="String" Description="分类" />
      <Column Name="Version" DataType="String" Description="版本" />
      <Column Name="CompileTime" DataType="DateTime" Description="编译时间" />
      <Column Name="OS" DataType="String" Length="100" Description="操作系统" />
      <Column Name="OSVersion" DataType="String" Description="系统版本" />
      <Column Name="Architecture" DataType="String" Description="架构。处理器架构,X86/X64/Arm/Arm64" />
      <Column Name="MachineName" DataType="String" Description="机器名称" />
      <Column Name="UserName" DataType="String" Description="用户名称" />
      <Column Name="IP" DataType="String" Length="200" Description="本地IP" />
      <Column Name="Cpu" DataType="Int32" Description="CPU" />
      <Column Name="Memory" DataType="Int32" Description="内存。单位M" />
      <Column Name="TotalSize" DataType="Int32" Description="磁盘。应用所在盘,单位M" />
      <Column Name="MaxOpenFiles" DataType="Int32" Description="最大打开文件。Linux上的ulimit -n" />
      <Column Name="Dpi" DataType="String" Description="像素点。默认96*96" />
      <Column Name="Resolution" DataType="String" Description="分辨率。例如1024*768" />
      <Column Name="Processor" DataType="String" Length="200" Description="处理器" />
      <Column Name="CpuID" DataType="String" Description="CPU标识" />
      <Column Name="Uuid" DataType="String" Description="唯一标识" />
      <Column Name="MachineGuid" DataType="String" Description="机器标识" />
      <Column Name="DiskID" DataType="String" Length="200" Description="磁盘序列号" />
      <Column Name="MACs" DataType="String" Length="200" Description="网卡" />
      <Column Name="InstallPath" DataType="String" Length="200" Description="安装路径" />
      <Column Name="Runtime" DataType="String" Description="运行时。.Net运行时版本,可知道本地已安装版本" />
      <Column Name="Framework" DataType="String" Description="目标框架。编译程序集时的目标版本" />
      <Column Name="ProvinceID" DataType="Int32" Description="省份" />
      <Column Name="CityID" DataType="Int32" Description="城市" />
      <Column Name="Address" DataType="String" Length="200" Description="地址" />
      <Column Name="Period" DataType="Int32" Description="采样周期。默认60秒" />
      <Column Name="WebHook" DataType="String" Length="500" Description="告警机器人。钉钉、企业微信等" />
      <Column Name="AlarmCpuRate" DataType="Int32" Description="CPU告警。CPU告警的百分比阈值,CPU使用率达到该值时告警,百分之一" />
      <Column Name="AlarmMemoryRate" DataType="Int32" Description="内存告警。内存告警的百分比阈值,内存使用率达到该值时告警,百分之一" />
      <Column Name="AlarmDiskRate" DataType="Int32" Description="磁盘告警。磁盘告警的百分比阈值,磁盘使用率达到该值时告警,百分之一" />
      <Column Name="AlarmTcp" DataType="Int32" Description="连接数告警。TCP连接数达到该值时告警,包括连接数、主动关闭和被动关闭" />
      <Column Name="AlarmProcesses" DataType="String" Description="进程告警。要守护的进程不存在时告警,多进程逗号隔开,支持*模糊匹配" />
      <Column Name="AlarmOnOffline" DataType="Boolean" Description="下线告警。节点下线时,发送告警" />
      <Column Name="Logins" DataType="Int32" Description="登录次数" />
      <Column Name="LastLogin" DataType="DateTime" Description="最后登录" />
      <Column Name="LastLoginIP" DataType="String" Description="最后IP。最后的公网IP地址" />
      <Column Name="OnlineTime" DataType="Int32" Description="在线时长。单位,秒" />
      <Column Name="CreateUserID" DataType="Int32" Description="创建者" />
      <Column Name="CreateTime" DataType="DateTime" Description="创建时间" />
      <Column Name="CreateIP" DataType="String" Description="创建地址" />
      <Column Name="UpdateUserID" DataType="Int32" Description="更新者" />
      <Column Name="UpdateTime" DataType="DateTime" Description="更新时间" />
      <Column Name="UpdateIP" DataType="String" Description="更新地址" />
      <Column Name="Remark" DataType="String" Length="500" Description="备注" />
    </Columns>
    <Indexes>
      <Index Columns="Code" Unique="True" />
      <Index Columns="Uuid,MachineGuid,MACs" />
      <Index Columns="UpdateTime" />
    </Indexes>
  </Table>
  <Table Name="NodeOnline" Description="节点在线">
    <Columns>
      <Column Name="ID" DataType="Int32" Identity="True" PrimaryKey="True" Description="编号" />
      <Column Name="SessionID" DataType="String" Description="会话" />
      <Column Name="NodeID" DataType="Int32" Description="节点" />
      <Column Name="Name" DataType="String" Master="True" Description="名称" />
      <Column Name="IP" DataType="String" Length="200" Description="本地IP" />
      <Column Name="Category" DataType="String" Description="分类" />
      <Column Name="ProvinceID" DataType="Int32" Description="省份" />
      <Column Name="CityID" DataType="Int32" Description="城市" />
      <Column Name="PingCount" DataType="Int32" Description="心跳" />
      <Column Name="Version" DataType="String" Description="版本" />
      <Column Name="CompileTime" DataType="DateTime" Description="编译时间" />
      <Column Name="Memory" DataType="Int32" Description="内存。单位M" />
      <Column Name="AvailableMemory" DataType="Int32" Description="可用内存。单位M" />
      <Column Name="AvailableFreeSpace" DataType="Int32" Description="可用磁盘。应用所在盘,单位M" />
      <Column Name="CpuRate" DataType="Double" Description="CPU率。占用率" />
      <Column Name="Temperature" DataType="Double" Description="温度" />
      <Column Name="Battery" DataType="Double" Description="电量" />
      <Column Name="UplinkSpeed" DataType="Int64" Description="上行速度。网络发送速度,字节每秒" />
      <Column Name="DownlinkSpeed" DataType="Int64" Description="下行速度。网络接收速度,字节每秒" />
      <Column Name="ProcessCount" DataType="Int32" Description="进程数" />
      <Column Name="TcpConnections" DataType="Int32" Description="连接数。传输数据Established的Tcp网络连接数" />
      <Column Name="TcpTimeWait" DataType="Int32" Description="主动关闭。主动关闭后TimeWait的Tcp网络连接数,下一步Closed" />
      <Column Name="TcpCloseWait" DataType="Int32" Description="被动关闭。被动关闭后CloseWait的Tcp网络连接数,下一步TimeWait" />
      <Column Name="Delay" DataType="Int32" Description="延迟。网络延迟,单位ms" />
      <Column Name="Offset" DataType="Int32" Description="偏移。客户端时间减服务端时间,单位s" />
      <Column Name="LocalTime" DataType="DateTime" Description="本地时间" />
      <Column Name="Uptime" DataType="Int32" Description="开机时间。单位s" />
      <Column Name="MACs" DataType="String" Length="200" Description="网卡" />
      <Column Name="Processes" DataType="String" Length="2000" Description="进程列表" />
      <Column Name="Token" DataType="String" Length="200" Description="令牌" />
      <Column Name="Data" DataType="String" Length="-1" Description="数据" />
      <Column Name="Creator" DataType="String" Description="创建者。服务端节点" />
      <Column Name="CreateTime" DataType="DateTime" Description="创建时间" />
      <Column Name="CreateIP" DataType="String" Description="创建地址" />
      <Column Name="UpdateTime" DataType="DateTime" Description="更新时间" />
      <Column Name="UpdateIP" DataType="String" Description="更新地址" />
    </Columns>
    <Indexes>
      <Index Columns="SessionID" Unique="True" />
      <Index Columns="Token" />
      <Index Columns="UpdateTime" />
      <Index Columns="ProvinceID,CityID" />
    </Indexes>
  </Table>
  <Table Name="NodeHistory" Description="节点历史" ConnName="NodeLog">
    <Columns>
      <Column Name="ID" DataType="Int64" PrimaryKey="True" Description="编号" />
      <Column Name="NodeID" DataType="Int32" Description="节点" />
      <Column Name="Name" DataType="String" Master="True" Description="名称" />
      <Column Name="ProvinceID" DataType="Int32" Description="省份" />
      <Column Name="CityID" DataType="Int32" Description="城市" />
      <Column Name="Action" DataType="String" Description="操作" />
      <Column Name="Success" DataType="Boolean" Description="成功" />
      <Column Name="Version" DataType="String" Description="版本" />
      <Column Name="CompileTime" DataType="DateTime" Description="编译时间" />
      <Column Name="Creator" DataType="String" Description="创建者。服务端节点" />
      <Column Name="CreateTime" DataType="DateTime" Description="创建时间" />
      <Column Name="CreateIP" DataType="String" Description="创建地址" />
      <Column Name="Remark" ColumnName="Content" DataType="String" Length="2000" Description="内容" />
    </Columns>
    <Indexes>
      <Index Columns="NodeID,Action" />
    </Indexes>
  </Table>
  <Table Name="NodeData" Description="节点数据。保存设备上来的一些数据,如心跳状态" ConnName="NodeLog">
    <Columns>
      <Column Name="ID" DataType="Int64" PrimaryKey="True" Description="编号" />
      <Column Name="NodeID" DataType="Int32" Description="节点" />
      <Column Name="Name" DataType="String" Master="True" Description="名称" />
      <Column Name="AvailableMemory" DataType="Int32" Description="可用内存。单位M" />
      <Column Name="AvailableFreeSpace" DataType="Int32" Description="可用磁盘。应用所在盘,单位M" />
      <Column Name="CpuRate" DataType="Double" Description="CPU率。占用率" />
      <Column Name="Temperature" DataType="Double" Description="温度" />
      <Column Name="Battery" DataType="Double" Description="电量" />
      <Column Name="UplinkSpeed" DataType="Int64" Description="上行速度。网络发送速度,字节每秒" />
      <Column Name="DownlinkSpeed" DataType="Int64" Description="下行速度。网络接收速度,字节每秒" />
      <Column Name="ProcessCount" DataType="Int32" Description="进程数" />
      <Column Name="TcpConnections" DataType="Int32" Description="连接数。传输数据Established的Tcp网络连接数" />
      <Column Name="TcpTimeWait" DataType="Int32" Description="主动关闭。主动关闭后TimeWait的Tcp网络连接数,下一步Closed" />
      <Column Name="TcpCloseWait" DataType="Int32" Description="被动关闭。被动关闭后CloseWait的Tcp网络连接数,下一步TimeWait" />
      <Column Name="Delay" DataType="Int32" Description="延迟。网络延迟,单位ms" />
      <Column Name="Offset" DataType="Int32" Description="偏移。客户端时间减服务端时间,单位s" />
      <Column Name="LocalTime" DataType="DateTime" Description="本地时间" />
      <Column Name="Uptime" DataType="Int32" Description="开机时间。单位s" />
      <Column Name="Creator" DataType="String" Description="创建者。服务端节点" />
      <Column Name="CreateTime" DataType="DateTime" Description="创建时间" />
      <Column Name="CreateIP" DataType="String" Description="创建地址" />
    </Columns>
    <Indexes>
      <Index Columns="NodeID" />
    </Indexes>
  </Table>
  <Table Name="NodeVersion" Description="节点版本。发布更新">
    <Columns>
      <Column Name="ID" DataType="Int32" Identity="True" PrimaryKey="True" Description="编号" />
      <Column Name="Version" DataType="String" Description="版本号" />
      <Column Name="Enable" DataType="Boolean" Description="启用。启用/停用" />
      <Column Name="Force" DataType="Boolean" Description="强制。强制升级" />
      <Column Name="Channel" DataType="Int32" Description="升级通道" Type="NodeChannels" />
      <Column Name="Strategy" DataType="String" Length="500" Description="策略。升级策略,node=abcd;version=1.0,1.1;runtime=5.0.*;framework=5.*;os=*Linux*;arch=Arm;province=31*;city=4509*" />
      <Column Name="Source" DataType="String" ItemType="file" Length="200" Description="升级源" />
      <Column Name="FileHash" DataType="String" Description="文件哈希。MD5散列" />
      <Column Name="Executor" DataType="String" Length="200" Description="执行命令。空格前后为文件名和参数" />
      <Column Name="CreateUserID" DataType="Int32" Description="创建者" />
      <Column Name="CreateTime" DataType="DateTime" Description="创建时间" />
      <Column Name="CreateIP" DataType="String" Description="创建地址" />
      <Column Name="UpdateUserID" DataType="Int32" Description="更新者" />
      <Column Name="UpdateTime" DataType="DateTime" Description="更新时间" />
      <Column Name="UpdateIP" DataType="String" Description="更新地址" />
      <Column Name="Description" DataType="String" Length="500" Description="描述" />
    </Columns>
    <Indexes>
      <Index Columns="Version" Unique="True" />
    </Indexes>
  </Table>
  <Table Name="NodeCommand" Description="节点命令">
    <Columns>
      <Column Name="ID" DataType="Int32" Identity="True" PrimaryKey="True" Description="编号" />
      <Column Name="NodeID" DataType="Int32" Description="节点" />
      <Column Name="Command" DataType="String" Master="True" Description="命令" />
      <Column Name="Argument" DataType="String" Length="500" Description="参数" />
      <Column Name="Expire" DataType="DateTime" Description="过期时间。未指定时表示不限制" />
      <Column Name="Status" DataType="Int32" Description="状态。命令状态" Type="CommandStatus" />
      <Column Name="Times" DataType="Int32" Description="次数。一共执行多少次,超过10次后取消" />
      <Column Name="Result" DataType="String" Length="500" Description="结果" />
      <Column Name="CreateUser" DataType="String" Description="创建者" />
      <Column Name="CreateUserID" DataType="Int32" Description="创建人" />
      <Column Name="CreateTime" DataType="DateTime" Description="创建时间" />
      <Column Name="CreateIP" DataType="String" Description="创建地址" />
      <Column Name="UpdateUserID" DataType="Int32" Description="更新者" />
      <Column Name="UpdateTime" DataType="DateTime" Description="更新时间" />
      <Column Name="UpdateIP" DataType="String" Description="更新地址" />
    </Columns>
    <Indexes>
      <Index Columns="NodeID,Status" />
      <Index Columns="NodeID,Command" />
      <Index Columns="UpdateTime,NodeID,Command" />
    </Indexes>
  </Table>
  <Table Name="NodeStat" Description="节点统计。每日统计">
    <Columns>
      <Column Name="ID" DataType="Int32" Identity="True" PrimaryKey="True" Description="编号" />
      <Column Name="StatDate" DataType="DateTime" Description="统计日期" />
      <Column Name="AreaID" DataType="Int32" Description="地区。省份,0表示全国" />
      <Column Name="Total" DataType="Int32" Description="总数。截止今天的全部设备数" />
      <Column Name="Actives" DataType="Int32" Description="活跃数。最后登录位于今天" />
      <Column Name="T7Actives" DataType="Int32" Description="7天活跃数。最后登录位于7天内" />
      <Column Name="T30Actives" DataType="Int32" Description="30天活跃数。最后登录位于30天内" />
      <Column Name="News" DataType="Int32" Description="新增数。今天创建" />
      <Column Name="T7News" DataType="Int32" Description="7天新增数。7天创建" />
      <Column Name="T30News" DataType="Int32" Description="30天新增数。30天创建" />
      <Column Name="Registers" DataType="Int32" Description="注册数。今天激活或重新激活" />
      <Column Name="MaxOnline" DataType="Int32" Description="最高在线。今天最高在线数" />
      <Column Name="MaxOnlineTime" DataType="DateTime" Description="最高在线时间" />
      <Column Name="CreateTime" DataType="DateTime" Description="创建时间" />
      <Column Name="UpdateTime" DataType="DateTime" Description="更新时间" />
      <Column Name="Remark" DataType="String" Length="500" Description="备注" />
    </Columns>
    <Indexes>
      <Index Columns="StatDate,AreaID" Unique="True" />
      <Index Columns="UpdateTime,AreaID" />
    </Indexes>
  </Table>
  <Table Name="RedisNode" Description="Redis节点。Redis管理">
    <Columns>
      <Column Name="Id" DataType="Int32" Identity="True" PrimaryKey="True" Description="编号" />
      <Column Name="Name" DataType="String" Master="True" Description="名称" />
      <Column Name="Category" DataType="String" Description="分类" />
      <Column Name="Server" DataType="String" Description="地址。含端口" />
      <Column Name="Password" DataType="String" Description="密码" />
      <Column Name="Version" DataType="String" Description="版本" />
      <Column Name="Mode" DataType="String" Description="模式" />
      <Column Name="MaxMemory" DataType="Int32" Description="内存容量。单位MB" />
      <Column Name="MemoryPolicy" DataType="String" Description="内存策略。缓存淘汰策略" />
      <Column Name="MemoryAllocator" DataType="String" Description="分配器。内存分配器,低版本有内存泄漏" />
      <Column Name="Enable" DataType="Boolean" Description="启用。停用的节点不再执行监控" />
      <Column Name="ScanQueue" DataType="Boolean" Description="队列。自动扫描发现消息队列,默认true" />
      <Column Name="WebHook" DataType="String" Length="500" Description="告警机器人。钉钉、企业微信等" />
      <Column Name="AlarmMemoryRate" DataType="Int32" Description="内存告警。内存告警的百分比阈值,百分之一" />
      <Column Name="AlarmConnections" DataType="Int32" Description="连接告警。连接数告警阈值" />
      <Column Name="AlarmSpeed" DataType="Int32" Description="速度告警。速度告警阈值" />
      <Column Name="AlarmInputKbps" DataType="Int32" Description="入流量告警。入流量告警阈值" />
      <Column Name="AlarmOutputKbps" DataType="Int32" Description="出流量告警。出流量告警阈值" />
      <Column Name="CreateUser" DataType="String" Description="创建人" />
      <Column Name="CreateUserID" DataType="Int32" Description="创建者" />
      <Column Name="CreateTime" DataType="DateTime" Description="创建时间" />
      <Column Name="CreateIP" DataType="String" Description="创建地址" />
      <Column Name="UpdateUser" DataType="String" Description="更新人" />
      <Column Name="UpdateUserID" DataType="Int32" Description="更新者" />
      <Column Name="UpdateTime" DataType="DateTime" Description="更新时间" />
      <Column Name="UpdateIP" DataType="String" Description="更新地址" />
      <Column Name="Remark" DataType="String" Length="500" Description="备注" />
    </Columns>
    <Indexes>
      <Index Columns="Server" Unique="True" />
    </Indexes>
  </Table>
  <Table Name="RedisData" Description="Redis数据。Redis监控" ConnName="NodeLog">
    <Columns>
      <Column Name="Id" DataType="Int64" PrimaryKey="True" Description="编号" />
      <Column Name="RedisId" DataType="Int32" Description="Redis节点" />
      <Column Name="Name" DataType="String" Master="True" Description="名称" />
      <Column Name="Speed" DataType="Int32" Description="速度。每秒操作数,instantaneous_ops_per_sec" />
      <Column Name="InputKbps" DataType="Double" Description="入流量。单位kbps" />
      <Column Name="OutputKbps" DataType="Double" Description="出流量。单位kbps" />
      <Column Name="Uptime" DataType="Int32" Description="启动时间。单位秒" />
      <Column Name="ConnectedClients" DataType="Int32" Description="连接数" />
      <Column Name="UsedMemory" DataType="Int32" Description="已用内存。单位MB" />
      <Column Name="FragmentationRatio" DataType="Double" Description="碎片率。单位MB" />
      <Column Name="Keys" DataType="Int64" Description="Keys数" />
      <Column Name="ExpiredKeys" DataType="Int64" Description="过期Keys" />
      <Column Name="EvictedKeys" DataType="Int64" Description="驱逐Keys。由于 maxmemory 限制,而被回收内存的 key 的总数" />
      <Column Name="KeySpaceHits" DataType="Int64" Description="命中数。只读请求命中缓存" />
      <Column Name="KeySpaceMisses" DataType="Int64" Description="Miss数。只读请求未命中缓存" />
      <Column Name="Commands" DataType="Int64" Description="命令数" />
      <Column Name="Reads" DataType="Int64" Description="读取数" />
      <Column Name="Writes" DataType="Int64" Description="写入数" />
      <Column Name="AvgTtl" DataType="Int64" Description="平均过期。平均过期时间,单位毫秒" />
      <Column Name="TopCommand" DataType="String" Length="200" Description="最忙命令" />
      <Column Name="CreateTime" DataType="DateTime" Description="创建时间" />
      <Column Name="Remark" DataType="String" Length="500" Description="备注" />
    </Columns>
    <Indexes>
      <Index Columns="RedisId,Id" />
    </Indexes>
  </Table>
  <Table Name="RedisMessageQueue" Description="Redis消息队列。Redis消息队列状态监控">
    <Columns>
      <Column Name="Id" DataType="Int32" Identity="True" PrimaryKey="True" Description="编号" />
      <Column Name="RedisId" DataType="Int32" Description="Redis节点" />
      <Column Name="Name" DataType="String" Master="True" Description="名称" />
      <Column Name="Category" DataType="String" Description="分类" />
      <Column Name="Db" DataType="Int32" Description="库" />
      <Column Name="Topic" DataType="String" Description="主题。消息队列主题" />
      <Column Name="Type" DataType="String" Description="类型。消息队列类型" />
      <Column Name="Consumers" DataType="Int32" Description="消费者。消费者个数" />
      <Column Name="Total" DataType="Int64" Description="总消费。现有消费者的消费总数" />
      <Column Name="Messages" DataType="Int32" Description="消息数。积压下来,等待消费的消息个数" />
      <Column Name="MaxMessages" DataType="Int32" Description="最大积压。达到该值时告警,0表示不启用" />
      <Column Name="Enable" DataType="Boolean" Description="启用。停用的节点不再执行监控" />
      <Column Name="FirstConsumer" DataType="DateTime" Description="最早消费者" />
      <Column Name="LastActive" DataType="DateTime" Description="最后活跃" />
      <Column Name="WebHook" DataType="String" Length="500" Description="告警机器人。钉钉、企业微信等" />
      <Column Name="CreateUser" DataType="String" Description="创建人" />
      <Column Name="CreateUserID" DataType="Int32" Description="创建者" />
      <Column Name="CreateTime" DataType="DateTime" Description="创建时间" />
      <Column Name="CreateIP" DataType="String" Description="创建地址" />
      <Column Name="UpdateUser" DataType="String" Description="更新人" />
      <Column Name="UpdateUserID" DataType="Int32" Description="更新者" />
      <Column Name="UpdateTime" DataType="DateTime" Description="更新时间" />
      <Column Name="UpdateIP" DataType="String" Description="更新地址" />
      <Column Name="Remark" DataType="String" Length="-1" Description="备注" />
    </Columns>
    <Indexes>
      <Index Columns="RedisId" />
    </Indexes>
  </Table>
</Tables>