pkg

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Username string
	Password string
	Ip       string
	Port     string
	Dbname   string
	Before   *basic
)

Functions

func BeforeRun

func BeforeRun(in string) error

func CollectEasy

func CollectEasy() []string

func Colorize

func Colorize(text string, status string, background string, underline bool, highshow bool) string

文字字体 参数介绍:text->文本内容 status->文字颜色 background->背景颜色 underline->是否下划线 highshow->是否高亮 http://www.cnblogs.com/frydsh/p/4139922.html

func CpuLoad

func CpuLoad() (string, error)

func CpuPercent

func CpuPercent() (string, error)

func DiskInfo

func DiskInfo() (string, error)

func FilterTitle

func FilterTitle(in string, count, interval int)

组装标题

func FilterValue

func FilterValue(in string, num, interval int, mysql *basic) error

if 顺序决定展示命令

func GetBytesColumns

func GetBytesColumns() string

func GetBytesTitle

func GetBytesTitle() string

func GetComColumns

func GetComColumns() string

func GetComTitle

func GetComTitle() string

func GetCpuColumns

func GetCpuColumns() string

func GetCpuTitle

func GetCpuTitle() string

func GetCurrentInterfaceCommands

func GetCurrentInterfaceCommands() ([]prompt.Suggest, error)

func GetDiskColumns

func GetDiskColumns() string

func GetDiskTitle

func GetDiskTitle() string

func GetHitColumns

func GetHitColumns() string

func GetHitTitle

func GetHitTitle() string

func GetInnodbDataColumns

func GetInnodbDataColumns() string

func GetInnodbDataTitle

func GetInnodbDataTitle() string

func GetInnodbLogColumns

func GetInnodbLogColumns() string

func GetInnodbLogTitle

func GetInnodbLogTitle() string

func GetInnodbPagesColumns

func GetInnodbPagesColumns() string

func GetInnodbPagesTitle

func GetInnodbPagesTitle() string

func GetInnodbRowsColumns

func GetInnodbRowsColumns() string

func GetInnodbRowsTitle

func GetInnodbRowsTitle() string

func GetInnodbStatusColumns

func GetInnodbStatusColumns() string

func GetInnodbStatusTitle

func GetInnodbStatusTitle() string

func GetIps

func GetIps() []string

func GetLoadColumns

func GetLoadColumns() string

func GetLoadTitle

func GetLoadTitle() string

func GetNetColumns

func GetNetColumns(detail bool) string

func GetNetTitle

func GetNetTitle(detail bool) string

func GetNowTime

func GetNowTime() string

func GetSemiColumns

func GetSemiColumns() string

func GetSemiTitle

func GetSemiTitle() string

func GetSlaveColumns

func GetSlaveColumns() string

func GetSlaveTitle

func GetSlaveTitle() string

func GetSwapColumns

func GetSwapColumns() string

func GetSwapTitle

func GetSwapTitle() string

func GetThreadsColumns

func GetThreadsColumns() string

func GetThreadsTitle

func GetThreadsTitle() string

func GetTimeColumns

func GetTimeColumns() string

func GetTimeTitle

func GetTimeTitle() string

func MysqlConn

func MysqlConn(username, password, ip, port, dbname string) (*sql.DB, error)

func NetInfo

func NetInfo(detail bool) (string, error)

func NewBasic

func NewBasic() *basic

func Prompt

func Prompt(msg string) string

func SwapIO

func SwapIO() (string, error)

func TimeNow

func TimeNow() (string, error)

Types

type MonitorDisk

type MonitorDisk struct {
	ReadCount        uint64 `json:"readCount"`
	MergedReadCount  uint64 `json:"mergedReadCount"`
	ReadBytes        uint64 `json:"readBytes"`
	ReadTime         uint64 `json:"readTime"`
	WriteCount       uint64 `json:"writeCount"`
	MergedWriteCount uint64 `json:"mergedWriteCount"`
	WriteBytes       uint64 `json:"writeBytes"`
	WriteTime        uint64 `json:"writeTime"`
	IopsInProgress   uint64 `json:"iopsInProgress"`
	IoTime           uint64 `json:"ioTime"`
	WeightedIO       uint64 `json:"weightedIO"`
}

func NewDisk

func NewDisk() (*MonitorDisk, error)

func (*MonitorDisk) Get

func (this *MonitorDisk) Get() error

get all disk

type MonitorLoad

type MonitorLoad struct {
	// contains filtered or unexported fields
}

func NewLoad

func NewLoad() *MonitorLoad

func (*MonitorLoad) Get

func (this *MonitorLoad) Get() (string, error)

type MonitorNet

type MonitorNet struct {
	BytesSent   uint64 `json:"bytesSent"`   // number of bytes sent
	BytesRecv   uint64 `json:"bytesRecv"`   // number of bytes received
	PacketsSent uint64 `json:"packetsSent"` // number of packets sent
	PacketsRecv uint64 `json:"packetsRecv"` // number of packets received
	Errin       uint64 `json:"errin"`       // total number of errors while receiving
	Errout      uint64 `json:"errout"`      // total number of errors while sending
	Dropin      uint64 `json:"dropin"`      // total number of incoming packets which were dropped
	Dropout     uint64 `json:"dropout"`     // total number of outgoing packets which were dropped (always 0 on OSX and BSD)
	Fifoin      uint64 `json:"fifoin"`      // total number of FIFO buffers errors while receiving
	Fifoout     uint64 `json:"fifoout"`     // total number of FIFO buffers errors while sendin
}

func NewNet

func NewNet() (*MonitorNet, error)

func (*MonitorNet) Get

func (this *MonitorNet) Get() error

func (*MonitorNet) PrintIps

func (this *MonitorNet) PrintIps() error

type MonitorSwap

type MonitorSwap struct {
	// contains filtered or unexported fields
}

func NewSwap

func NewSwap() (*MonitorSwap, error)

func (*MonitorSwap) Get

func (this *MonitorSwap) Get() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL