go_prometheus_basic_data

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

README

go_prometheus_basic_data

介绍

向prometheus推送系统基础信息

软件架构

软件架构说明

安装教程
  1. xxxx
  2. xxxx
  3. xxxx
使用说明
name info
mem_sys 从系统获取到的总内存
mem_heap_idle 堆空闲(申请未使用)
mem_heap_inuse 使用中堆内存
mem_stack_sys 系统分配作为运行栈的内存
mem_stack_inuse 正在使用栈内存
mem_active_object 活跃的对象
sys_use_cpu cpu使用情况平均值
sys_use_ram 内存使用情况平均值
sys_use_disk 磁盘使用情况平均值
mem_alloc 堆空间分配的字节数
参与贡献
  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request
特技
  1. 使用 Readme_XXX.md 来支持不同的语言,例如 Readme_en.md, Readme_zh.md
  2. Gitee 官方博客 blog.gitee.com
  3. 你可以 https://gitee.com/explore 这个地址来了解 Gitee 上的优秀开源项目
  4. GVP 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
  5. Gitee 官方提供的使用手册 https://gitee.com/help
  6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 https://gitee.com/gitee-stars/

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func MustRegister

func MustRegister()

func Update

func Update() error

Types

type Cpu

type Cpu struct {
	Cpus        []float64 `json:"cpus"`
	Cores       int       `json:"cores"`
	UsedPercent float64   `json:"used_percent"`
}

func GetCPU

func GetCPU() (c Cpu, err error)

type Disk

type Disk struct {
	UsedMB      int     `json:"usedMb"`
	UsedGB      int     `json:"usedGb"`
	TotalMB     int     `json:"totalMb"`
	TotalGB     int     `json:"totalGb"`
	UsedPercent float64 `json:"used_percent"`
}

func GetDisk

func GetDisk() (d Disk, err error)

type Ram

type Ram struct {
	UsedMB      int     `json:"usedMb"`
	TotalMB     int     `json:"totalMb"`
	UsedPercent float64 `json:"used_percent"`
}

func GetRAM

func GetRAM() (r Ram, err error)

Jump to

Keyboard shortcuts

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