{"id":37157494,"url":"https://github.com/boypt/gopsutil","last_synced_at":"2026-01-14T18:47:24.841Z","repository":{"id":57495130,"uuid":"208723288","full_name":"boypt/gopsutil","owner":"boypt","description":"psutil for golang","archived":false,"fork":true,"pushed_at":"2019-09-16T06:19:18.000Z","size":1623,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-14T03:02:36.826Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"shirou/gopsutil","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/boypt.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-16T06:12:04.000Z","updated_at":"2019-09-16T06:19:21.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/boypt/gopsutil","commit_stats":null,"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"purl":"pkg:github/boypt/gopsutil","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boypt%2Fgopsutil","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boypt%2Fgopsutil/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boypt%2Fgopsutil/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boypt%2Fgopsutil/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/boypt","download_url":"https://codeload.github.com/boypt/gopsutil/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boypt%2Fgopsutil/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28430904,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T16:38:47.836Z","status":"ssl_error","status_checked_at":"2026-01-14T16:34:59.695Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2026-01-14T18:47:24.015Z","updated_at":"2026-01-14T18:47:24.834Z","avatar_url":"https://github.com/boypt.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"gopsutil: psutil for golang\n==============================\n\n.. image:: https://circleci.com/gh/shirou/gopsutil.svg?\u0026style=shield\n        :target: https://circleci.com/gh/shirou/gopsutil\n\n.. image:: https://coveralls.io/repos/shirou/gopsutil/badge.svg?branch=master\n        :target: https://coveralls.io/r/shirou/gopsutil?branch=master\n\n.. image:: https://godoc.org/github.com/shirou/gopsutil?status.svg\n        :target: http://godoc.org/github.com/shirou/gopsutil\n\nThis is a port of psutil (https://github.com/giampaolo/psutil). The challenge is porting all\npsutil functions on some architectures.\n\n\nBreaking Changes! golang 1.8 is required\n-------------------------------------------\n\nAfter v2.17.04, golang 1.8 is required to build.\n\n\nTag semantics\n-------------------------\n\ngopsutil tag policy is almost same as Semantic Versioning, but automatically increase like Ubuntu versioning.\n\nfor example, `v2.17.04` means\n\n- v2: major version\n- 17: release year, 2017\n- 04: release month\n\ngopsutil aims to keep backwards-compatiblity until major version change.\n\nTaged at every end of month, but there are only a few commits, it can be skipped.\n\n\nAvailable Architectures\n------------------------------------\n\n- FreeBSD i386/amd64/arm\n- Linux i386/amd64/arm(raspberry pi)\n- Windows/amd64\n- Darwin i386/amd64\n- OpenBSD amd64 (Thank you @mpfz0r!)\n- Solaris amd64 (developed and tested on SmartOS/Illumos, Thank you @jen20!)\n\nAll works are implemented without cgo by porting c struct to golang struct.\n\n\nUsage\n---------\n\nNote: gopsutil v2 breaks compatibility. If you want to stay with compatibility, please use v1 branch and vendoring.\n\n.. code:: go\n\n   package main\n\n   import (\n       \"fmt\"\n\n       \"github.com/shirou/gopsutil/mem\"\n   )\n\n   func main() {\n       v, _ := mem.VirtualMemory()\n\n       // almost every return value is a struct\n       fmt.Printf(\"Total: %v, Free:%v, UsedPercent:%f%%\\n\", v.Total, v.Free, v.UsedPercent)\n\n       // convert to JSON. String() is also implemented\n       fmt.Println(v)\n   }\n\nThe output is below.\n\n::\n\n  Total: 3179569152, Free:284233728, UsedPercent:84.508194%\n  {\"total\":3179569152,\"available\":492572672,\"used\":2895335424,\"usedPercent\":84.50819439828305, (snip...)}\n\nYou can set an alternative location to :code:`/proc` by setting the :code:`HOST_PROC` environment variable.\n\nYou can set an alternative location to :code:`/sys` by setting the :code:`HOST_SYS` environment variable.\n\nYou can set an alternative location to :code:`/etc` by setting the :code:`HOST_ETC` environment variable.\n\nYou can set an alternative location to :code:`/var` by setting the :code:`HOST_VAR` environment variable.\n\nDocumentation\n------------------------\n\nsee http://godoc.org/github.com/shirou/gopsutil\n\nRequirements\n-----------------\n\n- go1.7 or above is required.\n\n\nMore Info\n--------------------\n\nSeveral methods have been added which are not present in psutil, but will provide useful information.\n\n- host/HostInfo()  (linux)\n\n  - Hostname\n  - Uptime\n  - Procs\n  - OS                    (ex: \"linux\")\n  - Platform              (ex: \"ubuntu\", \"arch\")\n  - PlatformFamily        (ex: \"debian\")\n  - PlatformVersion       (ex: \"Ubuntu 13.10\")\n  - VirtualizationSystem  (ex: \"LXC\")\n  - VirtualizationRole    (ex: \"guest\"/\"host\")\n\n- IOCounters\n\n  - Label (linux only)    The registered `device mapper name \u003chttps://www.kernel.org/doc/Documentation/ABI/testing/sysfs-block-dm\u003e`_\n\n- cpu/CPUInfo()  (linux, freebsd)\n\n  - CPU          (ex: 0, 1, ...)\n  - VendorID     (ex: \"GenuineIntel\")\n  - Family\n  - Model\n  - Stepping\n  - PhysicalID\n  - CoreID\n  - Cores        (ex: 2)\n  - ModelName    (ex: \"Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz\")\n  - Mhz\n  - CacheSize\n  - Flags        (ex: \"fpu vme de pse tsc msr pae mce cx8 ...\")\n  - Microcode\n\n- load/LoadAvg()  (linux, freebsd)\n\n  - Load1\n  - Load5\n  - Load15\n\n- docker/GetDockerIDList() (linux only)\n\n  - container id list ([]string)\n\n- docker/CgroupCPU() (linux only)\n\n  - user\n  - system\n\n- docker/CgroupMem() (linux only)\n\n  - various status\n\n- net_protocols (linux only)\n\n  - system wide stats on network protocols (i.e IP, TCP, UDP, etc.)\n  - sourced from /proc/net/snmp\n\n- iptables nf_conntrack (linux only)\n\n  - system wide stats on netfilter conntrack module\n  - sourced from /proc/sys/net/netfilter/nf_conntrack_count\n\nSome codes are ported from Ohai. many thanks.\n\n\nCurrent Status\n------------------\n\n- x: work\n- b: almost works, but something is broken\n\n=================== ====== ======= ======= ====== ======= =======\nname                Linux  FreeBSD OpenBSD MacOSX Windows Solaris\ncpu_times             x      x       x       x       x\ncpu_count             x      x       x       x       x\ncpu_percent           x      x       x       x       x\ncpu_times_percent     x      x       x       x       x\nvirtual_memory        x      x       x       x       x       b\nswap_memory           x      x       x       x\ndisk_partitions       x      x       x       x       x\ndisk_io_counters      x      x       x\ndisk_usage            x      x       x       x       x\nnet_io_counters       x      x       x       b       x\nboot_time             x      x       x       x       x\nusers                 x      x       x       x       x\npids                  x      x       x       x       x\npid_exists            x      x       x       x       x\nnet_connections       x              x       x\nnet_protocols         x\nnet_if_addrs\nnet_if_stats\nnetfilter_conntrack   x\n=================== ====== ======= ======= ====== =======\n\nProcess class\n^^^^^^^^^^^^^^^\n\n================ ===== ======= ======= ====== =======\nname             Linux FreeBSD OpenBSD MacOSX Windows\npid                 x     x      x       x       x\nppid                x     x      x       x       x\nname                x     x      x       x       x\ncmdline             x     x              x       x\ncreate_time         x                    x       x\nstatus              x     x      x       x\ncwd                 x\nexe                 x     x      x               x\nuids                x     x      x       x\ngids                x     x      x       x\nterminal            x     x      x       x\nio_counters         x     x      x               x\nnice                x     x      x       x       x\nnum_fds             x\nnum_ctx_switches    x\nnum_threads         x     x      x       x       x\ncpu_times           x                            x\nmemory_info         x     x      x       x       x\nmemory_info_ex      x\nmemory_maps         x\nopen_files          x\nsend_signal         x     x      x       x\nsuspend             x     x      x       x\nresume              x     x      x       x\nterminate           x     x      x       x       x\nkill                x     x      x       x\nusername            x     x      x       x       x\nionice\nrlimit              x\nnum_handlers\nthreads             x\ncpu_percent         x            x       x\ncpu_affinity\nmemory_percent\nparent              x            x       x       x\nchildren            x     x      x       x       x\nconnections         x            x       x\nis_running\npage_faults         x\n================ ===== ======= ======= ====== =======\n\nOriginal Metrics\n^^^^^^^^^^^^^^^^^^^\n\n================== ===== ======= ======= ====== ======= =======\nitem               Linux FreeBSD OpenBSD MacOSX Windows Solaris\n**HostInfo**\nhostname              x     x      x       x       x       x\n  uptime              x     x      x       x               x\n  proces              x     x      x                       x\n  os                  x     x      x       x       x       x\n  platform            x     x      x       x               x\n  platformfamily      x     x      x       x               x\n  virtualization      x\n**CPU**\n  VendorID            x     x      x       x       x      x\n  Family              x     x      x       x       x      x\n  Model               x     x      x       x       x      x\n  Stepping            x     x      x       x       x      x\n  PhysicalID          x                                   x\n  CoreID              x                                   x\n  Cores               x                            x      x\n  ModelName           x     x      x       x       x      x\n  Microcode           x                                   x\n**LoadAvg**\n  Load1               x     x      x       x\n  Load5               x     x      x       x\n  Load15              x     x      x       x\n**GetDockerID**\n  container id        x     no     no      no      no\n**CgroupsCPU**\n  user                x     no     no      no      no\n  system              x     no     no      no      no\n**CgroupsMem**\n  various             x     no     no      no      no\n================== ===== ======= ======= ====== ======= =======\n\n- future work\n\n  - process_iter\n  - wait_procs\n  - Process class\n\n    - as_dict\n    - wait\n\n\nLicense\n------------\n\nNew BSD License (same as psutil)\n\n\nRelated Works\n-----------------------\n\nI have been influenced by the following great works:\n\n- psutil: https://github.com/giampaolo/psutil\n- dstat: https://github.com/dagwieers/dstat\n- gosigar: https://github.com/cloudfoundry/gosigar/\n- goprocinfo: https://github.com/c9s/goprocinfo\n- go-ps: https://github.com/mitchellh/go-ps\n- ohai: https://github.com/opscode/ohai/\n- bosun: https://github.com/bosun-monitor/bosun/tree/master/cmd/scollector/collectors\n- mackerel: https://github.com/mackerelio/mackerel-agent/tree/master/metrics\n\nHow to Contribute\n---------------------------\n\n1. Fork it\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Commit your changes (git commit -am 'Add some feature')\n4. Push to the branch (git push origin my-new-feature)\n5. Create new Pull Request\n\nMy English is terrible, so documentation or correcting comments are also\nwelcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboypt%2Fgopsutil","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboypt%2Fgopsutil","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboypt%2Fgopsutil/lists"}