{"id":13760681,"url":"https://github.com/pesos/grofer","last_synced_at":"2025-04-07T10:19:27.522Z","repository":{"id":46588345,"uuid":"284296606","full_name":"pesos/grofer","owner":"pesos","description":"A system and resource monitoring tool written in Golang!","archived":false,"fork":false,"pushed_at":"2023-04-04T21:31:12.000Z","size":58632,"stargazers_count":371,"open_issues_count":18,"forks_count":53,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-31T09:03:17.389Z","etag":null,"topics":["cli","cobra","container-metrics","containers","cpu","cpu-utilization","disk-storage","docker","docker-metrics","go","golang","gopsutil","iowait","performance","performance-monitoring","resource-monitor","terminal-based","termui","tui"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pesos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null}},"created_at":"2020-08-01T16:26:03.000Z","updated_at":"2025-03-24T07:50:19.000Z","dependencies_parsed_at":"2023-02-13T18:30:39.003Z","dependency_job_id":"4cb6de1f-187d-4b1d-b0e6-712dd3eeb4d5","html_url":"https://github.com/pesos/grofer","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pesos%2Fgrofer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pesos%2Fgrofer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pesos%2Fgrofer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pesos%2Fgrofer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pesos","download_url":"https://codeload.github.com/pesos/grofer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247631834,"owners_count":20970069,"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":["cli","cobra","container-metrics","containers","cpu","cpu-utilization","disk-storage","docker","docker-metrics","go","golang","gopsutil","iowait","performance","performance-monitoring","resource-monitor","terminal-based","termui","tui"],"created_at":"2024-08-03T13:01:16.485Z","updated_at":"2025-04-07T10:19:27.494Z","avatar_url":"https://github.com/pesos.png","language":"Go","funding_links":[],"categories":["公用事业公司","Utilities","Go","Utility"],"sub_categories":["实用程序/Miscellaneous","Utility/Miscellaneous","Fail injection","HTTP Clients"],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"images/README/logo.png\" style=\"width:300px;\" /\u003e\n\u003c/p\u003e\n\ngrofer\n======\n\n[![Go Checks](https://github.com/pesos/grofer/actions/workflows/go-checks.yml/badge.svg)](https://github.com/pesos/grofer/actions/workflows/go-checks.yml) [![License Check](https://github.com/pesos/grofer/actions/workflows/license-check.yml/badge.svg)](https://github.com/pesos/grofer/actions/workflows/license-check.yml) [![Go Report Card](https://goreportcard.com/badge/github.com/pesos/grofer)](https://goreportcard.com/report/github.com/pesos/grofer) [![Go Reference](https://pkg.go.dev/badge/github.com/pesos/grofer.svg)](https://pkg.go.dev/github.com/pesos/grofer) [![Publish Development Docker Image](https://github.com/pesos/grofer/actions/workflows/docker-publish.yml/badge.svg?branch=main)](https://github.com/pesos/grofer/actions/workflows/docker-publish.yml) [![Publish Stable Docker Image](https://github.com/pesos/grofer/actions/workflows/docker-publish-stable.yml/badge.svg)](https://github.com/pesos/grofer/actions/workflows/docker-publish-stable.yml) [![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go)\n\n### Latest Stable Version: ![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/pesos/grofer?label=latest%20version\u0026sort=semver)\n\nA clean and modern system and resource monitor written purely in golang using [termui](https://github.com/gizak/termui) and [gopsutil](https://github.com/shirou/gopsutil)!\n\nCurrently compatible with Linux only.\n\nInstallation\n============\n\nUsing go get:\n\n```\ngo get -u github.com/pesos/grofer\n```\n\nAs an executable:\n\n```\ncurl -sSL https://github.com/pesos/grofer/releases/download/\u003cversion tag\u003e/grofer_\u003carchitecture\u003e --output grofer\nchmod +x grofer\n```\n\n`architecture`: underlying system architecture on which grofer will be run  \n - grofer_386  \n - grofer_amd64  \n - grofer_arm  \n - grofer_arm64\n\nFor system wide usage, install `grofer` to a location on `$PATH`, e.g. `/usr/local/bin`\n\n```\nmv grofer /usr/local/bin\n```\n\nBuilding from source:\n\n```\ngit clone https://github.com/pesos/grofer\ncd grofer\ngo build grofer.go\n```\n\n### Docker\n\n1.\tGet docker image using\n\n\t```\n\t  docker pull ghcr.io/pesos/grofer\n\t```\n\n\tNote: This will use the `latest` image which is built from the stable branch.\n\n\tFor previous releases, you will need to use the version number as the tag. Example: `docker pull ghcr.io/pesos/grofer:v1.2.0`\n\n\tFor the latest image from the `main` branch (development image). The tag `main` can be used. Example: `docker pull ghcr.io/pesos/grofer:main`\n\n2.\tRun using\n\n\t```bash\n\t     docker run \\\n\t      --name grofer \\\n\t      --rm -it \\\n\t      -v /:/host:ro \\\n\t      -v /var/run/docker.sock:/var/run/docker.sock:ro \\\n\t      --privileged \\\n\t      --pid=host \\\n\t      --network=host \\\n\t      ghcr.io/pesos/grofer\n\t```\n\n\tAdditional subcommands and flags to `grofer` can be passed directly at the end of the above command:\n\n\t```bash\n\t     docker run \\\n\t      --name grofer \\\n\t      --rm -it \\\n\t      -v /:/host:ro \\\n\t      -v /var/run/docker.sock:/var/run/docker.sock:ro \\\n\t      --privileged \\\n\t      --pid=host \\\n\t      --network=host \\\n\t      ghcr.io/pesos/grofer proc\n\t```\n\n\t```bash\n\t     docker run \\\n\t      --name grofer \\\n\t      --rm -it \\\n\t      -v /:/host:ro \\\n\t      -v /var/run/docker.sock:/var/run/docker.sock:ro \\\n\t      --privileged \\\n\t      --pid=host \\\n\t      --network=host \\\n\t      ghcr.io/pesos/grofer --help\n\t```\n\n3.\t(Optional) create an alias for `docker run` to be able to run it using just `grofer`\n\n\t```zsh\n\t     alias grofer=\"docker run \\\n\t      --name grofer \\\n\t      --rm -it \\\n\t      -v /:/host:ro \\\n\t      -v /var/run/docker.sock:/var/run/docker.sock:ro \\\n\t      --privileged \\\n\t      --pid=host \\\n\t      --network=host \\\n\t      ghcr.io/pesos/grofer\"\n\t```\n\n\tThen use `grofer` as normal:\n\n\t```bash\n\t     grofer --help\n\t```\n\n\t```bash\n\t     grofer proc\n\t```\n\n\tContainer metrics also work inside docker:\n\n\t```bash\n\t     grofer container\n\t```\n\n#### Building Docker image\n\n```bash\ndocker build -t ghcr.io/pesos/grofer .\n```\n\n---\n\nUsage\n=====\n\n```\ngrofer is a system and resource monitor written in golang.\n\nWhile using a TUI based command, press ? to get information about key bindings (if any) for that command.\n\nUsage:\n  grofer [flags]\n  grofer [command]\n\nAvailable Commands:\n  about       about is a command that gives information about the project in a cute way\n  completion  Generate completion script\n  container   container command is used to get information related to docker containers\n  export      Used to export profiled data.\n  help        Help about any command\n  proc        proc command is used to get per-process information\n\nFlags:\n      --config string   config file (default is $HOME/.grofer.yaml)\n  -c, --cpuinfo         Info about the CPU Load over all CPUs\n  -h, --help            help for grofer\n  -r, --refresh uint    Overall stats UI refreshes rate in milliseconds greater than 1000 (default 1000)\n\nUse \"grofer [command] --help\" for more information about a command.\n\n```\n\nDisplay Overall Metrics\n-----------------------\n\n```sh\ngrofer [FLAGS]\n```\n\nThe command displays the default root page which provides overall CPU, Memory, Network and Disk Metrics.\n\nOptional flags:\n\n-\t`-c | --cpuinfo`: Enabling this flag provides detailed information about CPU loads.\n\n-\t`-h | --help`: Provides help information about grofer.\n\n-\t`-r | --refresh UINT`: Sets the UI refresh rate in milliseconds. The number (UINT) provided must be greater than 1000\n\nDisplay Process Metrics\n-----------------------\n\n```sh\ngrofer proc [FLAGS]\n```\n\nThis command displays a table with information about all running processes. Additionally, it can be used to kill a running process too. Key-bindings for navigation and available process actions can be found by pressing `?` in the UI.\n\nOptional flags:\n\n-\t`-h | --help`: Provides help details for `grofer proc`.\n\n-\t`-p | --pid INT32`: Provides in depth metrics about process identified by given PID.\n\n-\t`-r | --refresh UINT`: Sets the UI refresh rate in milliseconds. Much like the root command, this value must be greater than 1000.\n\nDisplay Container Metrics\n-------------------------\n\n```sh\ngrofer container [FLAGS]\n```\n\nThis command displays information about all existing containers. Key-bindings for navigation and available container actions can be found by pressing `?` in the UI.\n\nOptional flags:\n\n-\t`-h | --help`: Provides help details for `grofer container`.\n\n-\t`-c | --container-id STRING`: Provides in depth metrics about the container identified by given ID.\n\n-\t`-r | --refresh UINT`: Sets the UI refresh rate in milliseconds. Much like the root command, this value must be greater than 1000.\n\nExport Metrics\n--------------\n\n```sh\ngrofer export [FLAGS]\n```\n\nThis command exports collected information to a specifc file format.\n\nOptional flags:\n\n-\t`-h | --help`: Provides help details for `grofer export`.\n\n-\t`-i | --iter UINT32`: Set the number of iterations to fetch data.\n\n-\t`-p | --pid INT32`: Specify the PID of the process to profile. If not set, all processes are are measured.\n\n-\t`-t | --type STRING`: Specify the export file format. Defaults to LJSON.\n\n-\t`-f | --filename STRING`: Specify the file to store the exported data in. Defaults to `grofer_profile`.\n\n-\t`-r | --refresh UINT`: Specify frequency of data fetch in milliseconds. default value taken as 1000.\n\nExamples\n========\n\n```\ngrofer\n```\n\n![grofer](images/README/grofer.png)\n\nInformation provided:  \n- CPU utilization per core  \n- Memory (RAM) usage  \n- Network usage  \n- Disk storage\n\n---\n\n```\ngrofer --cpuinfo\n```\n\nThe `-c, --cpuinfo` flag displays finer details about the CPU load such as percentage of the time spent servicing software interrupts, hardware interrupts, etc.\n\n![grofer-cpu](images/README/cpuload.png)\n\nInformation provided:  \n- Usr : % of time spent executing user level applications.  \n- Sys : % of time spent executing kernel level processes.  \n- Irq : % of time spent servicing hardware interrupts.  \n- Idle : % of time CPU was idle.  \n- Nice : % of time spent by CPU executing user level processes with a nice priority.  \n- Iowait: % of time spent by CPU waiting for an outstanding disk I/O.  \n- Soft : % of time spent by the CPU servicing software interrupts.  \n- Steal : % of time spent in involuntary waiting by logical CPUs.\n\n---\n\n```\ngrofer proc\n```\n\nThis lists all running processes and relevant information.\n\n![grofer-proc](images/README/grofer-proc.png)\n\n---\n\n```\ngrofer proc -p PID\n```\n\nThis gives information specific to a process, specified by a valid PID.\n\nPassing a PID of 0 will list all the processes instead (same as `grofer proc`).\n\n![grofer-proc-pid](images/README/grofer-proc-pid.png)\n\nInformation provided:\n\n-\tCPU utilization %\n\n-\tMemory utilization %\n\n-\tChild processes\n\n-\tNumber of voluntary and involuntary context switches\n\n-\tMemory usage (RSS, Data, Stack, Swap)\n\n---\n\n```\ngrofer container\n```\n\nThis provides overall container metrics.\n\n![grofer-container](Images/../images/README/grofer-container.png)\n\n---\n\n```\ngrofer container -c CID\n```\n\nThis provides per container metrics.\n\n![grofer-container-cid](Images/../images/README/grofer-container-cid.png)\n\nInformation provided:\n\n-\tCPU and Per CPU utilization %\n\n-\tMemory utilization %\n\n-\tContainer processes\n\n-\tVolume Mounts\n\n-\tAttached Networks\n\n-\tBlock and Network I/O\n\n-\tMetadata (Image, Name, ID, Status, State, PID)\n\n---\n\n```\ngrofer export -i 1 -p 1\n```\n\nThis allows exporting of profiled data either of system usage or data particular to that of a process. Data format is JSON by default.\n\n![grofer-export](images/README/grofer-export.png)\n\n---\n\nShell Completions\n=================\n\n`grofer` includes a subcommand to generate shell completion scripts to get autocompletion for subcommands and flags\n\nBash\n----\n\nTo get completions for current session only,\n\n```sh\nsource \u003c(grofer completion bash)\n```\n\nTo load completions for each session, the generated script must be moved to the completions directory. Take a look at the third question [here](https://github.com/scop/bash-completion/blob/master/README.md#faq) to find out the right place to put the script\n\nZsh\n---\n\nIf shell completion is not already enabled in your environment you will need to enable it. You can execute the following once:\n\n```sh\necho \"autoload -U compinit; compinit\" \u003e\u003e ~/.zshrc\n```\n\nTo load completions for each session, the generated script must be placed in a directory in your [fpath](http://zsh.sourceforge.net/Doc/Release/Functions.html). For a quick-and-dirty solution, run once:\n\n```sh\ngrofer completion zsh \u003e \"${fpath[1]}/_grofer\"\n```\n\nYou will need to start a new shell for this setup to take effect.\n\nFish\n----\n\nTo get completions for current session only,\n\n```sh\ngrofer completion fish | source\n```\n\nTo load completions for each session, the generated script must be moved to the completions directory\n\n```sh\ngrofer completion fish \u003e ~/.config/fish/completions/grofer.fish\n```\n\nCredits\n=======\n\n-\tGopher [artwork](images/README/logo.png) credits to [Amandeep Kaur](https://instagram.com/_amankaur._)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpesos%2Fgrofer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpesos%2Fgrofer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpesos%2Fgrofer/lists"}