{"id":13483856,"url":"https://github.com/crystal-community/hardware","last_synced_at":"2025-04-30T15:44:47.317Z","repository":{"id":27219027,"uuid":"112928304","full_name":"crystal-community/hardware","owner":"crystal-community","description":"Get CPU, Memory and Network informations of the running OS and its processes","archived":false,"fork":false,"pushed_at":"2021-12-23T02:31:50.000Z","size":86,"stargazers_count":72,"open_issues_count":6,"forks_count":10,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-10-25T01:58:37.300Z","etag":null,"topics":["cpu","crystal","hardware","memory","network","system"],"latest_commit_sha":null,"homepage":"https://crystal-community.github.io/hardware","language":"Crystal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crystal-community.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":"2017-12-03T13:01:47.000Z","updated_at":"2024-05-31T11:54:31.000Z","dependencies_parsed_at":"2022-07-18T10:39:27.727Z","dependency_job_id":null,"html_url":"https://github.com/crystal-community/hardware","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/crystal-community%2Fhardware","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crystal-community%2Fhardware/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crystal-community%2Fhardware/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crystal-community%2Fhardware/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crystal-community","download_url":"https://codeload.github.com/crystal-community/hardware/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222390366,"owners_count":16976545,"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":["cpu","crystal","hardware","memory","network","system"],"created_at":"2024-07-31T17:01:16.050Z","updated_at":"2024-11-02T03:03:43.534Z","avatar_url":"https://github.com/crystal-community.png","language":"Crystal","funding_links":[],"categories":["System"],"sub_categories":[],"readme":"# hardware\n\n[![GitHub release](https://img.shields.io/github/release/crystal-community/hardware.svg)](https://github.com/crystal-community/hardware/releases)\n[![Build Status](https://travis-ci.org/crystal-community/hardware.svg?branch=master)](https://travis-ci.org/crystal-community/hardware)\n\nA basic module to get CPU, memory and network informations of the current running OS and its processes.\n\nTested on Linux.\n\n## Installation\n\nAdd this to your application's `shard.yml`:\n\n```yaml\ndependencies:\n  hardware:\n    github: crystal-community/hardware\n```\n\n## Documentation\n\nThe documentation is accessible at https://crystal-community.github.io/hardware.\n\nIt is generated with [crystal docs](https://crystal-lang.org/docs/conventions/documenting_code.html) in the `gh-pages` branch.\n\n## Examples\n\n```crystal\nrequire \"hardware\"\n\nmemory = Hardware::Memory.new\nmemory.used         #=\u003e 2731404\nmemory.percent.to_i #=\u003e 32\n\ncpu = Hardware::CPU.new\npid_stat = Hardware::PID.new.stat            # Default is Process.pid\napp_stat = Hardware::PID.new(\"firefox\").stat # Take the first matching PID\n\nloop do\n  sleep 1\n  p cpu.usage!.to_i          #=\u003e 17\n  p pid_stat.cpu_usage!      #=\u003e 1.5\n  p app_stat.cpu_usage!.to_i #=\u003e 4\nend\n```\n## Development\n\n### Docker\n\nYou can run the specs in a Docker container:\n\n```sh\n$ docker-compose up\n$ docker-compose run spec\n```\n\n## Contributing\n\n1. Fork it ( https://github.com/crystal-community/hardware/fork )\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 a new Pull Request\n\n## Contributors\n\n- [bararchy](https://github.com/bararchy) - creator, maintainer   \n- [j8r](https://github.com/j8r) - contributor  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrystal-community%2Fhardware","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrystal-community%2Fhardware","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrystal-community%2Fhardware/lists"}