status

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	B  = 1
	KB = 1024 * B
	MB = 1024 * KB
	GB = 1024 * MB
)

Variables

This section is empty.

Functions

func CPUCheck

func CPUCheck(c *gin.Context)

@Summary /status/cpu @Description HealthCheck CPUCheck checks the cpu usage. @Tags status @Success 200 "CPU OK server run ok" @failure 429 "CPU WARNING need check" @failure 500 "CPU CRITICAL must check" @Router /status/cpu [get]

func DiskCheck

func DiskCheck(c *gin.Context)

@Summary /status/disk @Description HealthCheck DiskCheck checks the disk usage. @Tags status @Accept application/json @Produce application/json @Success 200 {object} status.Disk "value in monitor.status.Disk DISK OK less than 80% use, 80% to 90% is WARNING" @failure 429 {object} status.Disk "value in monitor.status.Disk DISK need check after 90%" @failure 500 "DISK CRITICAL must check!" @Router /status/disk [get]

func HealthCheck

func HealthCheck(c *gin.Context)

@Summary /status/health @Description HealthCheck shows OK as the ping-pong result. @Tags status @Success 200 "OK" @Router /status/health [get]

func RAMCheck

func RAMCheck(c *gin.Context)

@Summary /status/ram @Description HealthCheck RAMCheck checks the disk usage. @Tags status @Accept application/json @Produce application/json @Success 200 {object} status.RAM "value in monitor.status.RAM OK less than 80% use, 80% to 95% is WARNING" @failure 429 {object} status.RAM "value in monitor.status.RAM need check after 95%" @failure 500 "RAM CRITICAL must check!" @Router /status/ram [get]

Types

type Disk

type Disk struct {
	Info        string `json:"info,omitempty"`
	UsedMB      int    `json:"used_mb,omitempty"`
	UsedGB      int    `json:"used_gb,omitempty"`
	TotalMB     int    `json:"total_mb,omitempty"`
	TotalGB     int    `json:"total_gb,omitempty"`
	UsedPercent int    `json:"used_percent,omitempty"`
}

type RAM

type RAM struct {
	Info        string `json:"info,omitempty"`
	UsedMB      int    `json:"used_mb,omitempty"`
	UsedGB      int    `json:"used_gb,omitempty"`
	TotalMB     int    `json:"total_mb,omitempty"`
	TotalGB     int    `json:"total_gb,omitempty"`
	UsedPercent int    `json:"used_percent,omitempty"`
}

Jump to

Keyboard shortcuts

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