{"id":15676999,"url":"https://github.com/arthurkiller/perfm","last_synced_at":"2025-06-27T15:07:08.093Z","repository":{"id":57567885,"uuid":"63417466","full_name":"arthurkiller/perfm","owner":"arthurkiller","description":"a golang performance detector","archived":false,"fork":false,"pushed_at":"2022-09-21T11:48:26.000Z","size":1551,"stargazers_count":13,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-27T15:05:56.355Z","etag":null,"topics":["benchmark","golang","profilling"],"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/arthurkiller.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}},"created_at":"2016-07-15T11:37:18.000Z","updated_at":"2023-05-16T08:53:02.000Z","dependencies_parsed_at":"2022-08-28T07:40:55.473Z","dependency_job_id":null,"html_url":"https://github.com/arthurkiller/perfm","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/arthurkiller/perfm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthurkiller%2Fperfm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthurkiller%2Fperfm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthurkiller%2Fperfm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthurkiller%2Fperfm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arthurkiller","download_url":"https://codeload.github.com/arthurkiller/perfm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthurkiller%2Fperfm/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262279106,"owners_count":23286548,"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":["benchmark","golang","profilling"],"created_at":"2024-10-03T16:08:05.800Z","updated_at":"2025-06-27T15:07:08.060Z","avatar_url":"https://github.com/arthurkiller.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# perfm [![Build Status](https://travis-ci.org/arthurkiller/perfm.svg?branch=master)](https://travis-ci.org/arthurkiller/perfm) [![Go Report Card](https://goreportcard.com/badge/github.com/arthurkiller/perfm)](https://goreportcard.com/report/github.com/arthurkiller/perfm)\na golang performence testing platform\n\n## What's new\n* v3.0 is comming out\n* reconstruct the project, make design clean and clear\n* upgrade histogram implementation, now it can treate ___streaming data___ and caculate STDEV and CV\n\n## What's in it\n\n```\n┌─────────────────────────────────────────────┐\n│ ┌─Manager─────────────────┐      ┌───────┐  │\n│ │                         │     ┌┴──────┐│  │\n│ │                         │    ┌┴Workers││  │\n│ │                         ├────►       │││  │\n│ └──────────────────┬──────┘    │ Job   │││  │\n│                    │           │       │├┘  │\n│ ┌─Collector────────▼──────┐    │       ││   │\n│ │                         ◄────┤       ├┘   │\n│ │       Histogram         │    └───────┘    │\n│ └─────────────────────────┘                 │\n└─────────────────────────────────────────────┘\n```\n\n## Understand perfm Workflow\n\n* a perfm job work like this...\n```golang\nfor {\n    job.Pre()\n\n    start := time.Now()\n    job.Do()\n    count = time.Since(start)\n}\njob.After()\n```\n\n\n* perfm jobs work on different goroutine\n\n```bash\n    for parallels {\n        job.Copy()\n    }\n```\n\n```\n +---------+ +---------+ +---------+\n |   job   | |   job   | |   job   |\n |         | |         | |         |\n |for{     | |for{     | |for{     |\n | pre()   | | pre()   | | pre()   |\n | do()    | | do()    | | do()    | ... ...\n |}        | |}        | |}        |\n | after() | | after() | | after() |\n +---------+ +---------+ +---------+\n```\n\n\n## Short Example\n\n___2 steps to start your benchmark!___\n\n1. implement you own `perfm.Job`\n2. call `perfm.Start(Job)`\n\nYou can start with `Wizard.sh` creating your job templates.\n\nbasic http benchmark job by example\n```go\ntype job struct {\n\t// job private data\n\turl string\n}\n\n// Copy will called in parallel\nfunc (j *job) Copy() (perfm.Job,error) {\n\tjc := *j\n\treturn \u0026jc, nil\n}\n\nfunc (j *job) Pre() error {\n\t// do pre job, prepare the data\n    return nil\n}\nfunc (j *job) Do() error {\n\t// do benchmark job, the cost will be count\n\t_, err := http.Get(j.url)\n\treturn err\n}\nfunc (j *job) After() {\n\t// do clean job, only called in the end of the job\n}\n\n// start perfm\nperfm := perfm.New(perfm.WithBinsNumber(15), perfm.WithParallel(5), perfm.WithDuration(10))\nj := \u0026job{}\nj.url = \"http://www.baidu.com\"\nperfm.Start(j)\n```\n\n\u003cimg width=\"1358\" alt=\"image\" src=\"https://user-images.githubusercontent.com/11133870/167170304-6bb8a62f-4075-4409-8357-ada8a5974344.png\"\u003e\n\n## Milestone\n* version 0.1\n    support the qps and average cost counting\n* version 1.0\n    change the perfm into a testing interface, just rejuest and start, the test will be automaticly done\n* version 2.0\n    ~~add the excel/numbers .cvs file export. make it easy to draw graphic with other data processor.~~\n* version 3.0\n    * reconstruct on API and better support for streaming data.\n    * bug fixing\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farthurkiller%2Fperfm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farthurkiller%2Fperfm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farthurkiller%2Fperfm/lists"}