-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Document some exported Sys CPU stuff #31204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -64,6 +64,13 @@ See Hwloc.jl or CpuId.jl for extended information, including number of physical | |||||||||||
| """ | ||||||||||||
| CPU_THREADS = 1 # for bootstrap, changed on startup | ||||||||||||
|
|
||||||||||||
| """ | ||||||||||||
| Sys.CPU_NAME | ||||||||||||
|
|
||||||||||||
| The name of the host CPU as a string. | ||||||||||||
| """ | ||||||||||||
| CPU_NAME = "" # for bootstrap, changed on startup | ||||||||||||
|
|
||||||||||||
| """ | ||||||||||||
| Sys.ARCH | ||||||||||||
|
|
||||||||||||
|
|
@@ -188,6 +195,15 @@ function _cpu_summary(io::IO, cpu::AbstractVector{CPUinfo}, i, j) | |||||||||||
| println(io) | ||||||||||||
| end | ||||||||||||
|
|
||||||||||||
| """ | ||||||||||||
| Sys.cpu_summary(io::IO=stdout, cpu::AbstractVector{CPUinfo} = cpu_info()) | ||||||||||||
|
|
||||||||||||
| Print a summary of information about each processor in `cpu` gathered from [`cpu_info](@ref). This is generally: | ||||||||||||
| - Its index in the `cpu` vector | ||||||||||||
| - The CPU model | ||||||||||||
| - The CPU speed | ||||||||||||
| - The amount of time spent in `user`, `nice`, `sys`, `idle`, and `irq` modes | ||||||||||||
| """ | ||||||||||||
| function cpu_summary(io::IO=stdout, cpu::AbstractVector{CPUinfo} = cpu_info()) | ||||||||||||
| model = cpu[1].model | ||||||||||||
| first = 1 | ||||||||||||
|
|
@@ -200,6 +216,11 @@ function cpu_summary(io::IO=stdout, cpu::AbstractVector{CPUinfo} = cpu_info()) | |||||||||||
| _cpu_summary(io, cpu, first, length(cpu)) | ||||||||||||
| end | ||||||||||||
|
|
||||||||||||
| """ | ||||||||||||
| Sys.cpu_info() | ||||||||||||
|
|
||||||||||||
| Gather information about all CPUs in the system through a syscall using LibUV. | ||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. libuv is usually in lowercase but I am not sure it is needed in the docstring at all. We dont have any documentation about the type of struct getting returned There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we doc it for now then remove the export in the future? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
(and drop the corresponding list from |
||||||||||||
| """ | ||||||||||||
| function cpu_info() | ||||||||||||
| UVcpus = Ref{Ptr{UV_cpu_info_t}}() | ||||||||||||
| count = Ref{Int32}() | ||||||||||||
|
|
@@ -215,7 +236,7 @@ end | |||||||||||
| """ | ||||||||||||
| Sys.uptime() | ||||||||||||
|
|
||||||||||||
| Gets the current system uptime in seconds. | ||||||||||||
| Get the current system uptime in seconds. | ||||||||||||
| """ | ||||||||||||
| function uptime() | ||||||||||||
| uptime_ = Ref{Float64}() | ||||||||||||
|
|
||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps put this first since it is the first thing to show