{"id":19288516,"url":"https://github.com/samber/go-psi","last_synced_at":"2026-03-04T12:03:47.813Z","repository":{"id":167997079,"uuid":"643618162","full_name":"samber/go-psi","owner":"samber","description":"🥵 Pressure Stall Informations (PSI) and starvation notifier","archived":false,"fork":false,"pushed_at":"2025-12-05T11:25:30.000Z","size":40,"stargazers_count":10,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-15T12:33:33.770Z","etag":null,"topics":["cgroup2","cgroups","cpu","go","golang","io","linux","load","memory","notification","notifier","performance","pressure","psi","starvation","workload"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/samber/go-psi","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/samber.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["samber"]}},"created_at":"2023-05-21T18:22:11.000Z","updated_at":"2026-01-28T07:28:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"ebd1f30c-f18d-44ff-910c-c7fe6a1b5af6","html_url":"https://github.com/samber/go-psi","commit_stats":null,"previous_names":["samber/go-psi"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/samber/go-psi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samber%2Fgo-psi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samber%2Fgo-psi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samber%2Fgo-psi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samber%2Fgo-psi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samber","download_url":"https://codeload.github.com/samber/go-psi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samber%2Fgo-psi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30079565,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T11:57:42.557Z","status":"ssl_error","status_checked_at":"2026-03-04T11:56:10.793Z","response_time":59,"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":["cgroup2","cgroups","cpu","go","golang","io","linux","load","memory","notification","notifier","performance","pressure","psi","starvation","workload"],"created_at":"2024-11-09T22:09:15.284Z","updated_at":"2026-03-04T12:03:46.156Z","avatar_url":"https://github.com/samber.png","language":"Go","funding_links":["https://github.com/sponsors/samber"],"categories":[],"sub_categories":[],"readme":"\n# Pressure stall informations (PSI) and starvation notifier\n\n[![tag](https://img.shields.io/github/tag/samber/go-psi.svg)](https://github.com/samber/go-psi/releases)\n![Go Version](https://img.shields.io/badge/Go-%3E%3D%201.18.0-%23007d9c)\n[![GoDoc](https://godoc.org/github.com/samber/go-psi?status.svg)](https://pkg.go.dev/github.com/samber/go-psi)\n![Build Status](https://github.com/samber/go-psi/actions/workflows/test.yml/badge.svg)\n[![Go report](https://goreportcard.com/badge/github.com/samber/go-psi)](https://goreportcard.com/report/github.com/samber/go-psi)\n[![Coverage](https://img.shields.io/codecov/c/github/samber/go-psi)](https://codecov.io/gh/samber/go-psi)\n[![Contributors](https://img.shields.io/github/contributors/samber/go-psi)](https://github.com/samber/go-psi/graphs/contributors)\n[![License](https://img.shields.io/github/license/samber/go-psi)](./LICENSE)\n\nA few readings to getting started with PSI:\n- https://docs.kernel.org/accounting/psi.html\n- https://facebookmicrosites.github.io/psi/docs/overview\n- https://unixism.net/2019/08/linux-pressure-stall-information-psi-by-example/\n\n## 🚀 Install\n\n```sh\ngo get github.com/samber/go-psi\n```\n\nThis library is v1 and follows SemVer strictly. No breaking changes will be made to exported APIs before v2.0.0.\n\nRequires Linux kernel \u003e= 4.20.\n\n## 💡 Usage\n\nGoDoc: [https://pkg.go.dev/github.com/samber/go-psi](https://pkg.go.dev/github.com/samber/go-psi)\n\n### Retrieve current PSI state\n\n```go\nimport \"github.com/samber/go-psi\"\n\n// Get PSI for a single resource: psi.Memory or psi.CPU or psi.IO.\nstats, err := psi.PSIStatsForResource(psi.Memory)\n\n// Get all PSI stats.\nall, err := psi.AllPSIStats()\n```\n\n### Get PSI change notifications\n\n```go\nimport \"github.com/samber/go-psi\"\n\nonChange, done, err := psi.Notify(psi.Memory)\n\nfor {\n    last, _ := \u003c-onChange\n    fmt.Printf(\"\\nMemory:\\n%s\\n\", last)\n}\n\n// when you're done, just stop the notifier\ndone \u003c- struct{}{}\n```\n\n### Get PSI starvation alerts\n\n```go\nimport \"github.com/samber/go-psi\"\n\n// Alert starts when CPU 10s average go further 90% and stops when CPU goes below 70%.\nonAlert, done, err := psi.NotifyStarvation(psi.CPU, psi.Avg10, 70, 90)\n\nfor {\n    alert, _ := \u003c-onAlert\n    fmt.Printf(\"\\nALERT %t\\nCPU: %f%%\\n\", alert.Starved, alert.Current)\n}\n\n// when you're done, just stop the notifier\ndone \u003c- struct{}{}\n```\n\n## 🤝 Contributing\n\n- Ping me on Twitter [@samuelberthe](https://twitter.com/samuelberthe) (DMs, mentions, whatever :))\n- Fork the [project](https://github.com/samber/go-psi)\n- Fix [open issues](https://github.com/samber/go-psi/issues) or request new features\n\nDon't hesitate ;)\n\n```bash\n# Install some dev dependencies\nmake tools\n\n# Run tests\nmake test\n# or\nmake watch-test\n```\n\n## 👤 Contributors\n\n![Contributors](https://contrib.rocks/image?repo=samber/go-psi)\n\n## 💫 Show your support\n\nGive a ⭐️ if this project helped you!\n\n[![GitHub Sponsors](https://img.shields.io/github/sponsors/samber?style=for-the-badge)](https://github.com/sponsors/samber)\n\n## 📝 License\n\nCopyright © 2023 [Samuel Berthe](https://github.com/samber).\n\nThis project is [MIT](./LICENSE) licensed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamber%2Fgo-psi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamber%2Fgo-psi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamber%2Fgo-psi/lists"}