{"id":21966031,"url":"https://github.com/wgliang/goappmonitor","last_synced_at":"2025-04-06T01:08:47.814Z","repository":{"id":86736171,"uuid":"74099596","full_name":"wgliang/goappmonitor","owner":"wgliang","description":"Golang application performance data monitoring.","archived":false,"fork":false,"pushed_at":"2019-05-12T15:08:34.000Z","size":10242,"stargazers_count":491,"open_issues_count":2,"forks_count":44,"subscribers_count":28,"default_branch":"master","last_synced_at":"2025-03-30T00:07:36.527Z","etag":null,"topics":["agent","cpu-profiling","golang-application","memory-leak-detection","memory-profiler","monitor-performance","monitoring","performance-analysis","performance-metrics","performance-tuning","profiler","tracing"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wgliang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-18T05:54:16.000Z","updated_at":"2025-02-28T03:02:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"d5378ca5-b5f0-4fea-ad39-1198edb747e6","html_url":"https://github.com/wgliang/goappmonitor","commit_stats":null,"previous_names":["wgliang/appmonitor"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wgliang%2Fgoappmonitor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wgliang%2Fgoappmonitor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wgliang%2Fgoappmonitor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wgliang%2Fgoappmonitor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wgliang","download_url":"https://codeload.github.com/wgliang/goappmonitor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247419860,"owners_count":20936012,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent","cpu-profiling","golang-application","memory-leak-detection","memory-profiler","monitor-performance","monitoring","performance-analysis","performance-metrics","performance-tuning","profiler","tracing"],"created_at":"2024-11-29T12:56:41.832Z","updated_at":"2025-04-06T01:08:47.794Z","avatar_url":"https://github.com/wgliang.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"![goappmonitor](./logo.png)\n\n# goappmonitor\n[![Build Status](https://travis-ci.org/wgliang/goappmonitor.svg?branch=master)](https://travis-ci.org/wgliang/goappmonitor)\n[![codecov](https://codecov.io/gh/wgliang/goappmonitor/branch/master/graph/badge.svg)](https://codecov.io/gh/wgliang/goappmonitor)\n[![GoDoc](https://godoc.org/github.com/wgliang/goappmonitor?status.svg)](https://godoc.org/github.com/wgliang/goappmonitor)\n[![Join the chat at https://gitter.im/goappmonitor/Lobby](https://badges.gitter.im/goappmonitor/Lobby.svg)](https://gitter.im/goappmonitor/Lobby?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n[![Code Health](https://landscape.io/github/wgliang/goappmonitor/master/landscape.svg?style=flat)](https://landscape.io/github/wgliang/goappmonitor/master)\n[![Go Report Card](https://goreportcard.com/badge/github.com/wgliang/goappmonitor)](https://goreportcard.com/report/github.com/wgliang/goappmonitor)\n[![License](https://img.shields.io/badge/LICENSE-Apache2.0-ff69b4.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)\n\nGolang application performance data monitoring.\n\n\nGoAppMonitor is a library which provides a monitor on your golang applications. It contains system level based monitoring and business level monitoring(custom monitoring).Just add the repository into your apps and register what you want to monitoring.\n\n## Summary\n\nUsing GoAppMonitor to monitor the golang applications, in general as following:\n\nIn your golang application code, the user calls the statistics function provided by goappmonitor; when the statistics function is called, the appmonitor generates a statistical record, and is stored in memory.GoAppMonitor will automatically and regularly record these statistics push to the agent such as Open-Falcon agent.\n\n## Version\n\nCurrent version support:\n\n- v0.0.2\n\n\t* [Open-Falcon](https://github.com/XiaoMi/open-falcon) (Open source monitoring system of Xiaomi)\n\t* [InfluxDB](https://github.com/influxdata/influxdb) (Scalable datastore for metrics, events, and real-time analytics)\n\n### todo....\n\n* support more agent frameworks,such as elasticsearch...\n* go processes manager and debug online...\n\n\n## Install\n\n    go get github.com/wgliang/goappmonitor\n\n\n## Demo\n\n![demo](./doc/demo.png)\n\n## Usage\n\nBelow is an example which shows some common use cases for goappmonitor.  Check \n[example](https://github.com/wgliang/goappmonitor/blob/master/example) for more\nusage. \n\nDetail [API](./doc/API.md)\n\n```go\npackage main\n\nimport (\n\t\"math/rand\"\n\t\"time\"\n\n\tappm \"github.com/wgliang/goappmonitor\"\n)\n\n// Base or system performance data,such as memeory,gc,network and so on.\nfunc baseOrsystem() {\n\tfor _ = range time.Tick(time.Second * time.Duration(10)) {\n\t\t// (commonly used) Meter, used to sum and calculate the rate of change. Use scenarios\n\t\t// such as the number of home visits statistics, CG etc..\n\t\tpv := int64(rand.Int31n(100))\n\t\tappm.Meter(\"appm.meter\", pv)\n\t\tappm.Meter(\"appm.meter.2\", pv-50)\n\n\t\t// (commonly used) Gauge, used to preserve the value of the instantaneous value of the\n\t\t// type of record. Use scenarios such as statistical queue length, statistics CPU usage,\n\t\t// and so on.\n\t\tqueueSize := int64(rand.Int31n(100) - 50)\n\t\tappm.Gauge(\"appm.gauge\", queueSize)\n\n\t\tcpuUtil := float64(rand.Int31n(10000)) / float64(100)\n\t\tappm.GaugeFloat64(\"appm.gauge.float64\", cpuUtil)\n\t}\n}\n\n// Custom or business performance data,such as qps,num of function be called, task queue and so on.\nfunc customOrbusiness() {\n\tfor _ = range time.Tick(time.Second) {\n\t\t// Histogram, using the exponential decay sampling method, the probability distribution of\n\t\t// the statistical object is calculated. Using scenarios such as the probability distribution\n\t\t// of the statistics home page to access the delay\n\t\tdelay := int64(rand.Int31n(100))\n\t\tappm.Histogram(\"appm.histogram\", delay)\n\t}\n}\n\nfunc main() {\n\tvar ch chan int\n\tgo baseOrsystem()\n\tgo customOrbusiness()\n\t\u003c-ch\n}\n```\n\n## Credits\n\nRepository is base on goperfcounter of [niean](https://github.com/niean/goperfcounter)\n\nLogo is desigend by [xuri](https://github.com/Luxurioust)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwgliang%2Fgoappmonitor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwgliang%2Fgoappmonitor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwgliang%2Fgoappmonitor/lists"}