{"id":16475477,"url":"https://github.com/nikhita/systemstat","last_synced_at":"2025-06-24T07:09:10.652Z","repository":{"id":57485560,"uuid":"194187790","full_name":"nikhita/systemstat","owner":"nikhita","description":"GitHub mirror of https://bitbucket.org/bertimus9/systemstat.","archived":false,"fork":false,"pushed_at":"2019-06-28T01:48:45.000Z","size":22,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T17:01:04.556Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nikhita.png","metadata":{"files":{"readme":"README.md","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-06-28T01:46:49.000Z","updated_at":"2020-05-31T22:48:55.000Z","dependencies_parsed_at":"2022-09-02T00:10:18.312Z","dependency_job_id":null,"html_url":"https://github.com/nikhita/systemstat","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nikhita/systemstat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikhita%2Fsystemstat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikhita%2Fsystemstat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikhita%2Fsystemstat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikhita%2Fsystemstat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nikhita","download_url":"https://codeload.github.com/nikhita/systemstat/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikhita%2Fsystemstat/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261624970,"owners_count":23186120,"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":[],"created_at":"2024-10-11T12:38:23.635Z","updated_at":"2025-06-24T07:09:10.624Z","avatar_url":"https://github.com/nikhita.png","language":"Go","readme":"# systemstat\n\n[Documentation online](http://godoc.org/bitbucket.org/bertimus9/systemstat)\n\n**systemstat** is a package written in Go generated automatically by `gobi`.\n\n**systemstat** allows you to add system statistics to your go program; it\ncurrently polls the linux kernel for CPU usage, free/used memory and swap\nsizes, and uptime for your go process, as well as the system you're running it\non, and the system load. It can be used to make a crippled version of top that\nmonitors the current go process and ignores other processes and the number of\nusers with ttys. See the examples directory for go-top.go, which is my attempt\nat a top clone. Bear in mind that the intention of **systemstat** is to allow\nyour process to monitor itself and it's environment, not to replace top.\n\n## Install (with GOPATH set on your machine)\n----------\n\n* Step 1: Get the `systemstat` package\n\n```\ngo get bitbucket.org/bertimus9/systemstat\n```\n\n* Step 2 (Optional): Run tests\n\n```\n$ go test -v bitbucket.org/bertimus9/systemstat\n```\n\n* Step 3 (Optional): Run example\n\n```bash\n$ cd to the first directory in your $GOPATH\n$ cd src/bitbucket.org/bertimus9/systemstat\n$ go run examples/go-top.go\n```\n\n##Usage\n----------\n```\npackage main\n\nimport (\n\t\"bitbucket.org/bertimus9/systemstat\"\n\t\"fmt\"\n)\n\nvar sample systemstat.MemSample\n\n// This example shows how easy it is to get memory information\nfunc main() {\n\tsample = systemstat.GetMemSample()\n\tfmt.Println(\"Total available RAM in kb:\", sample.MemTotal, \"k total\")\n\tfmt.Println(\"Used RAM in kb:\", sample.MemUsed, \"k used\")\n\tfmt.Println(\"Free RAM in kb:\", sample.MemFree, \"k free\")\n\tfmt.Printf(\"The output is similar to, but somewhat different than:\\n\\ttop -n1 | grep Mem:\\n\")\n}\n```\n\n##License\n----------\n\nCopyright (c) 2013 Phillip Bond\n\nLicensed under the MIT License\n\nsee file LICENSE\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikhita%2Fsystemstat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnikhita%2Fsystemstat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikhita%2Fsystemstat/lists"}