文件名称:
Go应用性能数据监控GoAppMonitor.zip
开发工具:
文件大小: 168kb
下载次数: 0
上传时间: 2019-07-19
详细说明: GoAppMonitor —— Golang 应用性能数据监控。这是一个 Go 开发库,为你的 Go 应用程序提供监控功能。包含系统级别的监控和业务级别监控。监控效果:示例代码:package main import ( "math/rand" "time" appm "github.com/wgliang/goappmonitor" ) // Base or system performance data,such as memeory,gc,network and so on. func baseOrsystem() { for _ = range time.Tick(time.Second * time.Duration(10)) { // (commonly used) Meter, used to sum and calculate the rate of change. Use scenarios // such as the number of home visits statistics, CG etc.. pv := int64(rand.Int31n(100)) appm.Meter("appm.meter", pv) appm.Meter("appm.meter.2", pv-50) // (commonly used) Gauge, used to preserve the value of the instantaneous value of the // type of record. Use scenarios such as statistical queue length, statistics CPU usage, // and so on. queueSize := int64(rand.Int31n(100) - 50) appm.Gauge("appm.gauge", queueSize) cpuUtil := float64(rand.Int31n(10000)) / float64(100) appm.GaugeFloat64("appm.gauge.float64", cpuUtil) } } // Custom or business performance data,such as qps,num of function be called, task queue and so on. func customOrbusiness() { for _ = range time.Tick(time.Second) { // Histogram, using the exponential decay sampling method, the probability distribution of // the statistical object is calculated. Using scenarios such as the probability distribution // of the statistics home page to access the delay delay := int64(rand.Int31n(100)) appm.Histogram("appm.histogram", delay) } } func main() { var ch chan int go baseOrsystem() go customOrbusiness() <-ch }
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.
相关搜索: