{"id":28089247,"url":"https://github.com/vikyd/go-cpu-load","last_synced_at":"2025-05-13T12:55:33.241Z","repository":{"id":57530714,"uuid":"146690390","full_name":"vikyd/go-cpu-load","owner":"vikyd","description":"Generate CPU load on Windows/Linux/Mac","archived":false,"fork":false,"pushed_at":"2020-03-10T14:43:20.000Z","size":25,"stargazers_count":44,"open_issues_count":1,"forks_count":15,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-20T12:40:59.356Z","etag":null,"topics":["cpu","golang","linux","load","mac","windows"],"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/vikyd.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":"2018-08-30T03:24:29.000Z","updated_at":"2024-05-31T09:12:13.000Z","dependencies_parsed_at":"2022-09-14T00:20:13.613Z","dependency_job_id":null,"html_url":"https://github.com/vikyd/go-cpu-load","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vikyd%2Fgo-cpu-load","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vikyd%2Fgo-cpu-load/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vikyd%2Fgo-cpu-load/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vikyd%2Fgo-cpu-load/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vikyd","download_url":"https://codeload.github.com/vikyd/go-cpu-load/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253948333,"owners_count":21988953,"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":["cpu","golang","linux","load","mac","windows"],"created_at":"2025-05-13T12:55:32.247Z","updated_at":"2025-05-13T12:55:33.225Z","avatar_url":"https://github.com/vikyd.png","language":"Go","readme":"# go-cpu-load\n\nGenerate CPU load on Windows/Linux/Mac.\n\n# Install\n\n```sh\ngo get -u github.com/vikyd/go-cpu-load\n```\n\nor download binary file directly\n\n# Usage\n\nexample 01: run 30% of all CPU cores for 10 seconds\n\n```sh\ngo-cpu-load -p 30 -t 10\n```\n\nexample 02: run 30% of all CPU cores forver\n\n```sh\ngo-cpu-load -p 30\n```\n\nexample 03: run 30% of 2 of CPU cores for 10 seconds\n\n```sh\ngo-cpu-load -p 30 -c 2 -t 10\n```\n\n- `all CPU load` = (num of para `c` _ num of `p`) / (all cores count of CPU _ 100)\n- may not specify cores run the load only, it just promise the `all CPU load`, and not promise each cores run the same load\n\n# Parameters\n\n```\n--coresCount value, -c value   how many cores (optional, default: 8)\n\n--timeSeconds value, -t value  how long (optional, default: 2147483647)\n\n--percentage value, -p value   percentage of each specify cores (required)\n\n--help, -h                     show help\n```\n\n# Build\n\n```sh\ngo build\n```\n\n# test\n\n```sh\ngo test -v\n```\n\n\u003e currently only provide Windows testing\n\n# How it runs\n\n- Giving a range of time(e.g. 100ms)\n- Want to run 30% of all CPU cores\n  - 30ms: run (CPU 100%)\n  - 70ms: sleep(CPU 0%)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvikyd%2Fgo-cpu-load","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvikyd%2Fgo-cpu-load","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvikyd%2Fgo-cpu-load/lists"}