Skip to content

Commit

Permalink
Merge pull request #4 from AtelierArith/terasaki/define-monitor
Browse files Browse the repository at this point in the history
Define `monitor` function as entrypoint
  • Loading branch information
terasakisatoshi authored Dec 6, 2024
2 parents 601b1b8 + 0fe76ad commit 807f046
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ Alternatively, you can launch the functionality directly from Julia:

```julia
$ julia --project
julia> using TerminalSystemMonitor: main; main()
julia> using TerminalSystemMonitor; monitor()
```

### Monitoring GPU Usage

Please load `CUDA.jl` package in advance:

```julia
julia> using CUDA; using TerminalSystemMonitor: main; main()
julia> using CUDA; using TerminalSystemMonitor; monitor()
```

## Why not `htop`?
Expand All @@ -117,15 +117,21 @@ julia> using Htop_jll; run(Htop_jll.htop())

However, `Htop_jll` only supports Unix-based systems. The TerminalSystemMonitor.jl package also supports Windows as long as Term.jl and UnicodePlots.jl are available on the platform.

## Why not `bottom`?
## Why not `btm`?

You can also use [ClementTsang/bottom](https://github.com/ClementTsang/bottom), also known as the `btm` command:

```sh
$ btm -b
```
btm -b

We could use `bottom_jll` instead:

```julia
julia> using bottom_jll; run(`$(btm()) --basic`)
```

However, our Julia package [TerminalSystemMonitor.jl](https://github.com/AtelierArith/TerminalSystemMonitor.jl) offers a cross-platform solution that integrates directly with Julia, providing similar functionality in a familiar environment.
Our Julia package [TerminalSystemMonitor.jl](https://github.com/AtelierArith/TerminalSystemMonitor.jl) offers a cross-platform solution and adopts responsive design; chaging layout nicely based on your terminal size.

## Can I visualize GPU Apple Silicon processors?

Expand Down
6 changes: 6 additions & 0 deletions src/TerminalSystemMonitor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ using UnicodePlots
import Term # this is required by UnicodePlots.panel
using MLDataDevices: MLDataDevices, CUDADevice

export monitor # entrypoint from REPL

# These function will be defined in Package extensions
function plot_gpu_utilization_rates end
function plot_gpu_memory_utilization end
Expand Down Expand Up @@ -129,6 +131,10 @@ function plot_cpu_memory_utilization()

end

function monitor(args...)
main(args...)
end

function main(dummyargs...)
hidecursor()

Expand Down

0 comments on commit 807f046

Please sign in to comment.