mongo

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KDBMonitor       = "monitor"
	KCollMonitorData = "monitor_data"
	KCollUserLog     = "user_log"
)

Variables

View Source
var (
	MonitorDataColl *mongo.Collection
	UserLogColl     *mongo.Collection

	Timeout time.Duration
)

Functions

func Init

func Init() error

func InitCollections

func InitCollections()

Types

type CpuInfo

type CpuInfo struct {
	Models          []string `json:"models"            bson:"models"`
	LogicCoreNum    int      `json:"logic_core_num"    bson:"logic_core_num"`
	PhysicalCoreNum int      `json:"physical_core_num" bson:"physical_core_num"`
	Usage           float64  `json:"usage"             bson:"usage"`
}

type DiskInfo

type DiskInfo struct {
	Total uint64 `json:"total" bson:"total"`
	Used  uint64 `json:"used"  bson:"used"`
}

type MemInfo

type MemInfo struct {
	Total  uint64 `json:"total"  bson:"total"`
	Actual uint64 `json:"actual" bson:"actual"`
	Swap   uint64 `json:"swap"   bson:"swap"`
}

type MongoDBConfig

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

type MonitorData

type MonitorData struct {
	Id        string       `json:"id"         bson:"_id"`
	AgentName string       `json:"agent_name" bson:"agent_name"`
	System    string       `json:"system"     bson:"system"`
	Network   *NetworkInfo `json:"network"    bson:"network"`
	Cpu       *CpuInfo     `json:"cpu"        bson:"cpu"`
	Mem       *MemInfo     `json:"mem"        bson:"mem"`
	Disk      *DiskInfo    `json:"disk"       bson:"disk"`
	Time      int64        `json:"time"       bson:"time"`
}

type NetworkInfo

type NetworkInfo struct {
	Ips []string `json:"ips"      bson:"ips"`
	Ios int      `json:"ios"      bson:"ios"`
}

type UserLog

type UserLog struct {
	UserId      string      `json:"user_id"      bson:"user_id"`
	Time        int64       `json:"time"         bson:"time"`
	QueryParams interface{} `json:"query_params" bson:"query_params"`
}

Jump to

Keyboard shortcuts

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