hardware
Version, currently 0.5.09 versions
github.com/crystal-community/hardware
Get CPU, Memory and Network informations of the running OS and its processes
76 stars
1 dependent
License: MIT
Nothing has been indexed for 0.5.0 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
hardware:
github: crystal-community/hardware
version: ~> 0.5.0Then run:
shards installshard.yml
No shard.yml has been indexed for 0.5.0. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
# hardware
[](https://github.com/crystal-community/hardware/actions?query=workflow%3ACI)
[](https://crystal-community.github.io/hardware)
[](https://en.wikipedia.org/wiki/ISC_license)
A basic module to get CPU, memory and network informations of the current running OS and its processes.
Tested on Linux.
## Installation
Add this to your application's `shard.yml`:
```yaml
dependencies:
hardware:
github: crystal-community/hardware
```
## Documentation
The documentation is accessible at https://crystal-community.github.io/hardware.
It is generated with [crystal docs](https://crystal-lang.org/docs/conventions/documenting_code.html) in the `gh-pages` branch.
## Examples
```crystal
require "hardware"
memory = Hardware::Memory.new
memory.used #=> 2731404
memory.percent.to_i #=> 32
cpu = Hardware::CPU.new
pid_stat = Hardware::PID.new.stat # Default is Process.pid
app_stat = Hardware::PID.new("firefox").stat # Take the first matching PID
loop do
sleep 1
p cpu.usage!.to_i #=> 17
p pid_stat.cpu_usage! #=> 1.5
p app_stat.cpu_usage!.to_i #=> 4
end
```
## Development
### Docker
You can run the specs in a Docker container:
```sh
$ docker-compose up
$ docker-compose run spec
```
## Contributing
1. Fork it ( https://github.com/crystal-community/hardware/fork )
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature')
4. Push to the branch (git push origin my-new-feature)
5. Create a new Pull Request
## Contributors
- [bararchy](https://github.com/bararchy) - creator, maintainer
- [j8r](https://github.com/j8r) - maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.5.0- Tagged
- Dec 21, 2025
- Commit
4be634b02aac- Indexed
- not yet
Dependents
Repository
github.com/crystal-community/hardware
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 12, 2026
- Synced
- Aug 12, 2026
- Versions
- 9