{"id":19657240,"url":"https://github.com/daheige/mux-chi","last_synced_at":"2025-04-28T19:31:53.440Z","repository":{"id":57746706,"uuid":"175843906","full_name":"daheige/mux-chi","owner":"daheige","description":"Customized based on lightweight go-chi/chi framework for fast build of go api applications","archived":false,"fork":false,"pushed_at":"2023-02-15T06:41:18.000Z","size":156,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T10:23:52.801Z","etag":null,"topics":["api","go-chi","http","mux-chi"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daheige.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":"2019-03-15T15:16:41.000Z","updated_at":"2023-08-30T01:39:38.000Z","dependencies_parsed_at":"2024-06-20T09:30:33.911Z","dependency_job_id":"5e9669dd-b7a1-4d9a-afd3-bac60d937f5e","html_url":"https://github.com/daheige/mux-chi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daheige%2Fmux-chi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daheige%2Fmux-chi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daheige%2Fmux-chi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daheige%2Fmux-chi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daheige","download_url":"https://codeload.github.com/daheige/mux-chi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224128555,"owners_count":17260456,"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":["api","go-chi","http","mux-chi"],"created_at":"2024-11-11T15:30:59.159Z","updated_at":"2024-11-11T15:31:27.371Z","avatar_url":"https://github.com/daheige.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mux-chi\n\n  基于go-chi/chi框架定制而成，可快速构建http api(restful api)应用。\n\n# golang版本\n\n  建议用golang1.10+以上版本\n\n# 日志插件\n\n  基于zap实现每天流动式日志，可将日志记录到文件或输出到终端。\n\n# 性能监控\n\n    采用net/http/pprof包\n        浏览器访问http://localhost:2338/debug/pprof，就可以查看\n    在命令终端查看：\n        安装graphviz\n            $ apt install graphviz\n        查看profile\n            go tool pprof http://localhost:2338/debug/pprof/profile?seconds=60\n            (pprof) top 10 --cum --sum\n            (pprof) web  #web页面查看cpu使用情况\n\n            每一列的含义：\n            flat：给定函数上运行耗时\n            flat%：同上的 CPU 运行耗时总比例\n            sum%：给定函数累积使用 CPU 总比例\n            cum：当前函数加上它之上的调用运行总耗时\n            cum%：同上的 CPU 运行耗时总比例\n\n        它会收集30s的性能profile,可以用go tool查看\n            go tool pprof profile /home/heige/pprof/pprof.go-api.samples.cpu.002.pb.gz\n        查看heap和goroutine\n            查看活动对象的内存分配情况\n            go tool pprof http://localhost:2338/debug/pprof/heap\n            go tool pprof http://localhost:2338/debug/pprof/goroutine\n        \n        prometheus性能监控\n        http://localhost:2338/metrics\n\n# wrk工具压力测试\n\n    https://github.com/wg/wrk\n    \n    ubuntu系统安装如下\n    1、安装wrk\n        # 安装 make 工具\n        sudo apt-get install make git\n        \n        # 安装 gcc编译环境\n        sudo apt-get install build-essential\n        sudo mkdir /web/\n        sudo chown -R $USER /web/\n        cd /web/\n        git clone https://github.com/wg/wrk.git\n        # 开始编译\n        cd /web/wrk\n        make\n    2、wrk压力测试\n        $ wrk -c 100 -t 8 -d 2m http://localhost:1338/index\n        Running 2m test @ http://localhost:1338/index\n        8 threads and 100 connections\n        Thread Stats   Avg      Stdev     Max   +/- Stdev\n            Latency    17.45ms   31.76ms 633.02ms   95.52%\n            Req/Sec     0.95k   180.65     1.64k    72.94%\n        882466 requests in 2.00m, 148.96MB read\n        Socket errors: connect 0, read 0, write 0, timeout 96\n        Requests/sec:   7351.26\n        Transfer/sec:      1.24MB\n\n# 第三方包\n\n  redisgo\n  gorm\n  go-chi/chi https://github.com/go-chi/chi\n  thinkgo github.com/daheige/thinkgo\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaheige%2Fmux-chi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaheige%2Fmux-chi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaheige%2Fmux-chi/lists"}