Documentation
¶
Index ¶
- func CommondResult(commond string) (result string, err error)
- func CommondShell(commond string, argv []string) (err error)
- func CompressFile(absolutePath string) (data []byte, err error)
- func FileText(file string, beginLine, endLine int64) (begin, end int64, info []string, err error)
- func GetPartitionInfo(path string) (total, used, free uint64, err error)
- func IsDirectory(path string) (result bool)
- func IsExist(path string) (result bool)
- func IsFile(path string) (result bool)
- func MaxInt32(a, b int32) int32
- func MaxInt64(a, b int64) int64
- func MinInt32(a, b int32) int32
- func MinInt64(a, b int64) int64
- func NetworkInterfaceBandwidth(network string) (bandwidth uint64, err error)
- func Pow(x uint64, y int) (result uint64)
- func ReabableSize(size uint64) (result string)
- type ByDiskName
- type CapacityInfo
- type DebugInfo
- type DiskStatisticInfo
- type GgfServiceInfo
- type GitInfo
- type IOInfo
- type LogInfo
- type MemoryStatisticInfo
- type MemoryUseInfo
- type NTPInfo
- type NetworkStatisticInfo
- type NtpControlType
- type Priority
- type ProcessInfo
- type ServiceInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommondResult ¶
func CommondShell ¶
func GetPartitionInfo ¶
func NetworkInterfaceBandwidth ¶
获取网络接口的网络带宽
func ReabableSize ¶
把byte转换为K,M,G,T等易读的字符串,小数点后保留一位有效数组
Types ¶
type ByDiskName ¶
type ByDiskName []DiskStatisticInfo
func (ByDiskName) Len ¶
func (a ByDiskName) Len() int
func (ByDiskName) Less ¶
func (a ByDiskName) Less(i, j int) bool
func (ByDiskName) Swap ¶
func (a ByDiskName) Swap(i, j int)
type CapacityInfo ¶
type CapacityInfo struct { TotalCapacity uint64 `json:"total_capacity"` // 总容量 TotalCapacityReadable string `json:"total_capacity_readable"` // 总容量(阅读友好的) UsedCapacity uint64 `json:"used_capacity"` // 已经使用的容量 UsedCapacityReadable string `json:"used_capacity_readable"` // 已经使用的容量(阅读友好的) AvailableCapacity uint64 `json:"available_capacity"` // 空闲的容量 AvailableCapacityReadable string `json:"available_capacity_readable"` // 空闲的容量(阅读友好的) }
容量信息
func (*CapacityInfo) String ¶
func (c *CapacityInfo) String() string
type DiskStatisticInfo ¶
type DiskStatisticInfo struct { Rrqm uint64 `json:"rrqm/s"` Wrqm uint64 `json:"wrqm/s"` Read uint64 `json:"r/s"` Write uint64 `json:"w/s"` ReadByte uint64 `json:"rkB/s"` ReadByteReadable string `json:"read_byte_readable"` WriteByte uint64 `json:"wkB/s"` WriteByteReadable string `json:"write_byte_readable"` Avgrq uint64 `json:"avgrq-sz"` Avgqu uint64 `json:"avgqu-sz"` Await uint64 `json:"await"` Rawait uint64 `json:"r_await"` Wawait uint64 `json:"w_await"` Name string `json:"name"` SerialNumber string `json:"serialNumber"` Svctm uint64 `json:"svctm"` Util uint64 `json:"util"` }
磁盘统计
func (*DiskStatisticInfo) String ¶
func (d *DiskStatisticInfo) String() string
type GgfServiceInfo ¶
type GgfServiceInfo struct {
ServiceInfo
}
主机服务
func (*GgfServiceInfo) String ¶
func (o *GgfServiceInfo) String() string
type GitInfo ¶
type GitInfo struct { Branch string `json:"branch"` // 分支 Commit string `json:"commit"` // id Version string `json:"version"` // 版本信息 }
git信息
type IOInfo ¶
type IOInfo struct { ReadCount uint64 `json:"read_count"` WriteCount uint64 `json:"write_count"` ReadByte uint64 `json:"read_byte"` ReadByteReadable string `json:"read_byte_readable"` WriteByte uint64 `json:"write_byte"` WriteByteReadable string `json:"write_byte_readable"` }
io信息
type MemoryStatisticInfo ¶
type MemoryStatisticInfo struct { TotalCapacity uint64 `json:"total_capacity"` // 总容量 TotalCapacityReadable string `json:"total_capacity_readable"` // 总容量(阅读友好的) UsedSize uint64 `json:"used_size"` // 已经使用的容量 UsedSizeReadable string `json:"used_size_readable"` // 已经使用的容量(阅读友好的) AvailableSize uint64 `json:"available_size"` // 可用的 AvailableSizeReadable string `json:"available_size_readable"` // 可读性好的可用的内存 BufferSize uint64 `json:"buffer_size"` // buffer的size BufferSizeReadable string `json:"buffer_size_readable"` // 可读性好的buffer size CacheSize uint64 `json:"cache_size"` // cache的size CacheSizeReadable string `json:"cache_size_readable"` // 可读性好的cache的size }
内存使用情况的统计
func (*MemoryStatisticInfo) String ¶
func (m *MemoryStatisticInfo) String() string
type MemoryUseInfo ¶
type MemoryUseInfo struct { UsedPrecent float64 `json:"used_precent"` // 内存占用的百分比 RSS uint64 `json:"rss"` // 提交到物理内存中的内存使用 RSSReadable string `json:"rss_readable"` // 提交到物理内存中的内存使用 VMS uint64 `json:"vms"` // 虚拟内存 VMSReadable string `json:"vms_readable"` // 可读性好的虚拟内存 Data uint64 `json:"data"` // 数据段占用的内存, DataReadable string `json:"data_readable"` }
内存使用情况
func (*MemoryUseInfo) String ¶
func (m *MemoryUseInfo) String() string
type NTPInfo ¶
type NTPInfo struct { IP string `json:"ip"` // ntp服务器IP Port int32 `json:"port"` // ntp端口 ProofreadInterval int64 `json:"proofread_interval"` // 校对间隔 Enable bool `json:"enable"` // 是否启用ntp校时 }
NTP信息
type NetworkStatisticInfo ¶
type NetworkStatisticInfo struct { Name string `json:"name"` //网口的名称 ReceiveByte uint64 `json:"receive_byte"` // 接收的数据 ReceiveByteReadable string `json:"receive_byte_readable"` // 接收的数据(易于读的) SendByte uint64 `json:"send_byte"` // 发送的数据 SendByteReadable string `json:"send_byte_readable"` // 接收的数据(易于读的) CapacityByte uint64 `json:"capacity_byte"` // 网口的总容量 CapacityByteReadable string `json:"capacity_byte_readable"` // 接收的数据(易于读的) ReceivePacket uint64 `json:"receive_packet"` // 接收的数据包 SendPacket uint64 `json:"send_packet"` // 发送的数据包 ReceiveError uint64 `json:"receive_error"` // 接收到的错误的包 SendError uint64 `json:"send_error"` // 发送的错误的包 ReceiveDrop uint64 `json:"receive_drop"` // 丢弃的接收的包 SendDrop uint64 `json:"send_drop"` // 丢弃的发送的包 }
网络统计信息
func (*NetworkStatisticInfo) String ¶
func (n *NetworkStatisticInfo) String() string
type NtpControlType ¶
type NtpControlType string
ntp 操作类型
const ( Ntp_Control_Test NtpControlType = "test" Ntp_Control_Set NtpControlType = "set" )
type ProcessInfo ¶
type ProcessInfo struct { Name string `json:"service"` // 服务名称 Pid int32 `json:"pid"` // 进程名称 ThreadCount int32 `json:"thread_count"` // 线程个数 CPU float64 `json:"cpu"` // cpu的使用率 Startup string `json:"startup"` // 程序启动时间 Command string `json:"command"` // 启动参数 Memory MemoryUseInfo `json:"memory"` // 内存使用情况 Disk IOInfo `json:"disk"` // io使用 Network NetworkStatisticInfo `json:"network"` }
进程的信息
func (*ProcessInfo) String ¶
func (p *ProcessInfo) String() string
Click to show internal directories.
Click to hide internal directories.