{"id":19309675,"url":"https://github.com/roxma/aps-agent","last_synced_at":"2025-10-24T12:36:52.279Z","repository":{"id":82181115,"uuid":"56427623","full_name":"roxma/aps-agent","owner":"roxma","description":"Application Performance Statistics","archived":false,"fork":false,"pushed_at":"2016-09-28T03:15:24.000Z","size":114,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-30T23:03:02.587Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/roxma.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-04-17T08:56:27.000Z","updated_at":"2017-11-01T06:30:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"bc52242b-d518-4cbd-98ed-869af8932fae","html_url":"https://github.com/roxma/aps-agent","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/roxma/aps-agent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roxma%2Faps-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roxma%2Faps-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roxma%2Faps-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roxma%2Faps-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roxma","download_url":"https://codeload.github.com/roxma/aps-agent/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roxma%2Faps-agent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278786672,"owners_count":26045588,"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","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-10T00:20:14.516Z","updated_at":"2025-10-07T13:55:45.416Z","avatar_url":"https://github.com/roxma.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n# Application Performance Statistics - 实时性能/可用性监控工具\n\n## 功能\n\n- 通过嵌入代码的方式统计代码块（调用远程服务，MySQL增删改查，Redis读写）的成功率，耗时，错误码分布，实现秒级别监控。\n- （二期，server）统计数据收集，Web页面实现分钟级别的数据查询，展示，自动根据成功率变化发出预警。\n\n## 性能考虑\n\n- 轻量级，发送数据不阻塞业务代码，不影响业务本身可用性\n- 高性能，实测单机可达20万/s以上的数据收集和处理速度。\n- 资源占用少。\n- 使用 UNIX domain socket Datagram 发送/收集数据，极端情况下允许数据丢失。\n\n## 为什么做这件事情？\n\n- 数据处理性能高，微秒级调用，不阻塞业务代码，可以用于在线上环境实时统计性能数据，方便找出系统的性能瓶颈（请求量，延时历史数据变化趋势），让系统调优工作有据可依。\n- 未来可用于根据服务可用性（成功率）变化发出警报。\n\n\n## 使用介绍\n\n### 安装部署\n\n- make，然后 make rpm 生成 rpm 文件\n- 根据提示，找到生成的 rpm 文件路径，root 权限执行 rpm -ivh\n    - 如果没有 root 权限安装 rpm，make 后可以先执行 `./bin/aps-agent $(whoami) unix_socket_dir log_dir` 用于测试。\n- 启动 aps-agent，/usr/local/aps-agent\n- 数据发送接口参考 report_api 的内容，文件底部的注释包含使用例子。\n\n### 查看实时数据\n\n![实时数据](./doc/stat_print.py.gif)\n\n### 查看错误码统计\n\n![实时数据](./doc/code_min.png)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froxma%2Faps-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froxma%2Faps-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froxma%2Faps-agent/lists"}