Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Generate CPU load on Windows/Linux/Mac

License

NotificationsYou must be signed in to change notification settings

vikyd/go-cpu-load

Repository files navigation

Generate CPU load on Windows/Linux/Mac.

Install

go get -u github.com/vikyd/go-cpu-load

or download binary file directly

Usage

example 01: run 30% of all CPU cores for 10 seconds

go-cpu-load -p 30 -t 10

example 02: run 30% of all CPU cores forver

go-cpu-load -p 30

example 03: run 30% of 2 of CPU cores for 10 seconds

go-cpu-load -p 30 -c 2 -t 10
  • all CPU load = (num of parac _ num ofp) / (all cores count of CPU _ 100)
  • may not specify cores run the load only, it just promise theall CPU load, and not promise each cores run the same load

Parameters

--coresCount value, -c value   how many cores (optional, default: 8)--timeSeconds value, -t value  how long (optional, default: 2147483647)--percentage value, -p value   percentage of each specify cores (required)--help, -h                     show help

Build

go build

test

gotest -v

currently only provide Windows testing

How it runs

  • Giving a range of time(e.g. 100ms)
  • Want to run 30% of all CPU cores
    • 30ms: run (CPU 100%)
    • 70ms: sleep(CPU 0%)

About

Generate CPU load on Windows/Linux/Mac

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp