Skip to content

采集cpu/内存/磁盘占用/io状态/负载/内外网卡流量等相关指标

Notifications You must be signed in to change notification settings

lycclsltt/system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

采集linux指标, 可用于监控

覆盖如下几类:

  • cpu
  • 内存
  • io状态
  • 磁盘占用
  • 负载
  • 内、外网卡的流入、流出流量等

使用

go get github.com/lycclsltt/system

package main

import(
	"github.com/lycclsltt/system"
)

func main() {
    mem := &system.Mem{}
    mem.Collect()
    println("used:", mem.MemUsedFunc(""), "kb")
    println("free:", mem.MemFreeFunc(""), "kb")
}

更多监控项请参考源码注释.

About

采集cpu/内存/磁盘占用/io状态/负载/内外网卡流量等相关指标

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages