Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/x4trm/top-go
Unix Top program clone
https://github.com/x4trm/top-go
golang unix
Last synced: 4 days ago
JSON representation
Unix Top program clone
- Host: GitHub
- URL: https://github.com/x4trm/top-go
- Owner: x4trm
- Created: 2024-08-20T17:19:33.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2024-09-12T15:53:39.000Z (2 months ago)
- Last Synced: 2024-09-13T04:38:14.692Z (2 months ago)
- Topics: golang, unix
- Language: Go
- Homepage:
- Size: 1.69 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Go System Monitor
## Overview
This project is a simple system monitor tool implemented in Go inspired by the `top` command in Linux. It provides real-time monitoring of system resources, displaying the 20 most CPU-intensive processes along with various system statistics such as CPU usage, memory usage, and load average.
## Features
- **Top Processes:** Displays the top 20 processes by CPU usage.
- **System Information:** Shows uptime, load average, CPU usage breakdown, memory usage, and swap usage.
- **Process Details:** Each process is shown with details including PID, user, priority, CPU usage, memory usage, command line, and CPU time.
- **Real-Time Update:** The monitor refreshes every second to provide real-time updates.## Installation
To install the Go System Monitor, make sure you have Go installed, then clone this repository and build the project:
```bash
$ git clone https://github.com/x4trm/top-go.git
$ cd top-go/cmd/top-go
$ go build
```## Usage
Run the compiled binary
```bash
$ ./top-go
```## Dependencies
This project uses the following Go libraries:
`github.com/shirou/gopsutil/v3`: For retrieving system and process information.## Project Structure
`main.go`: The main entry point of the application.
`internal/monitor/`: Contains the logic for collecting system and process information.
`internal/display/`: Contains the logic for rendering the collected data to the terminal.## Example Output
![screen](./screen.png)