{"id":15019136,"url":"https://github.com/threez/ruby-vmstat","last_synced_at":"2025-04-04T21:09:39.994Z","repository":{"id":4857294,"uuid":"6011909","full_name":"threez/ruby-vmstat","owner":"threez","description":"A focused and fast library to gather memory, cpu, network, load avg and disk information","archived":false,"fork":false,"pushed_at":"2022-09-09T08:26:31.000Z","size":162,"stargazers_count":71,"open_issues_count":2,"forks_count":14,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-28T20:09:06.513Z","etag":null,"topics":["cpu","disk","freebsd","linux","macosx","netbsd","openbsd","ruby","smartos","solaris","vmstat"],"latest_commit_sha":null,"homepage":"http://threez.github.com/ruby-vmstat/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"tj/connect-redis","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/threez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-09-29T18:36:48.000Z","updated_at":"2023-02-25T04:21:01.000Z","dependencies_parsed_at":"2022-08-20T17:40:26.517Z","dependency_job_id":null,"html_url":"https://github.com/threez/ruby-vmstat","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threez%2Fruby-vmstat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threez%2Fruby-vmstat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threez%2Fruby-vmstat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threez%2Fruby-vmstat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/threez","download_url":"https://codeload.github.com/threez/ruby-vmstat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247249530,"owners_count":20908212,"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","disk","freebsd","linux","macosx","netbsd","openbsd","ruby","smartos","solaris","vmstat"],"created_at":"2024-09-24T19:53:02.740Z","updated_at":"2025-04-04T21:09:39.966Z","avatar_url":"https://github.com/threez.png","language":"Ruby","readme":"# Vmstat [![Build Status](https://secure.travis-ci.org/threez/ruby-vmstat.png)](http://travis-ci.org/threez/ruby-vmstat) [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/threez/ruby-vmstat)\n\nThis is a focused and fast library to get system information like:\n\n* _Memory_ (free, active, ...)\n* _Network Interfaces_ (name, in bytes, out bytes, ...)\n* _CPU_ (user, system, nice, idle)\n* _Load_ Average\n* _Disk_ (type, disk path, free bytes, total bytes, ...)\n* _Boot Time_\n* _Current Task_ (used bytes and usage time *MAC OS X / Linux ONLY*)\n\n*It currently supports:*\n\n* FreeBSD\n* MacOS X\n* Linux (\u003e= 2.6)\n* OpenBSD\n* NetBSD\n* Solaris/SmartOS\n\n*It might support (but not tested):*\n\n* Older versions of linux\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'vmstat'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install vmstat\n\n## Usage\n\nJust require the library and make a snapshot or use the distinct methods to just capture parts of the statistics. For further information have a look at the [rdoc](http://rdoc.info/gems/vmstat/frames).\n\n\trequire \"vmstat\"\n\t\n\tVmstat.snapshot # =\u003e #\u003cVmstat::Snapshot:0x007fe5f22df660\n\t#\t @at=2012-10-09 21:48:57 +0200,\n\t#\t @boot_time=2012-10-09 18:42:37 +0200,\n\t#\t @cpus=\n\t#\t  [#\u003cstruct Vmstat::Cpu\n\t#\t    num=0,\n\t#\t    user=187167,\n\t#\t    system=144466,\n\t#\t    nice=0,\n\t#\t    idle=786622\u003e,\n\t#\t   #\u003cstruct Vmstat::Cpu num=1, user=2819, system=1641, nice=0, idle=1113782\u003e,\n\t#\t   #\u003cstruct Vmstat::Cpu num=2, user=158698, system=95186, nice=0, idle=864359\u003e,\n\t#\t   #\u003cstruct Vmstat::Cpu num=3, user=2702, system=1505, nice=0, idle=1114035\u003e,\n\t#\t   #\u003cstruct Vmstat::Cpu num=4, user=140231, system=78248, nice=0, idle=899764\u003e,\n\t#\t   #\u003cstruct Vmstat::Cpu num=5, user=2468, system=1314, nice=0, idle=1114460\u003e,\n\t#\t   #\u003cstruct Vmstat::Cpu num=6, user=120764, system=66284, nice=0, idle=931195\u003e,\n\t#\t   #\u003cstruct Vmstat::Cpu num=7, user=2298, system=1207, nice=0, idle=1114737\u003e],\n\t#\t @disks=\n\t#\t  [#\u003cstruct Vmstat::Disk\n\t#\t    type=:hfs,\n\t#\t    origin=\"/dev/disk0s2\",\n\t#\t    mount=\"/\",\n\t#\t    block_size=4096,\n\t#\t    free_blocks=51470668,\n\t#\t    available_blocks=51406668,\n\t#\t    total_blocks=61069442\u003e],\n\t#\t @load_average=\n\t#\t  #\u003cstruct Vmstat::LoadAverage\n\t#\t   one_minute=1.74072265625,\n\t#\t   five_minutes=1.34326171875,\n\t#\t   fifteen_minutes=1.1845703125\u003e,\n\t#\t @memory=\n\t#\t  #\u003cstruct Vmstat::Memory\n\t#\t   pagesize=4096,\n\t#\t   wired=1037969,\n\t#\t   active=101977,\n\t#\t   inactive=484694,\n\t#\t   free=470582,\n\t#\t   pageins=102438,\n\t#\t   pageouts=0\u003e,\n\t#\t @network_interfaces=\n\t#\t  [#\u003cstruct Vmstat::NetworkInterface\n\t#\t    name=:lo0,\n\t#\t    in_bytes=6209398,\n\t#\t    in_errors=0,\n\t#\t    in_drops=0,\n\t#\t    out_bytes=6209398,\n\t#\t    out_errors=0,\n\t#\t    type=24\u003e,\n\t#\t   #\u003cstruct Vmstat::NetworkInterface\n\t#\t    name=:gif0,\n\t#\t    in_bytes=0,\n\t#\t    in_errors=0,\n\t#\t    in_drops=0,\n\t#\t    out_bytes=0,\n\t#\t    out_errors=0,\n\t#\t    type=55\u003e,\n\t#\t   #\u003cstruct Vmstat::NetworkInterface\n\t#\t    name=:stf0,\n\t#\t    in_bytes=0,\n\t#\t    in_errors=0,\n\t#\t    in_drops=0,\n\t#\t    out_bytes=0,\n\t#\t    out_errors=0,\n\t#\t    type=57\u003e,\n\t#\t   #\u003cstruct Vmstat::NetworkInterface\n\t#\t    name=:en0,\n\t#\t    in_bytes=1321276010,\n\t#\t    in_errors=0,\n\t#\t    in_drops=0,\n\t#\t    out_bytes=410426678,\n\t#\t    out_errors=0,\n\t#\t    type=6\u003e,\n\t#\t   #\u003cstruct Vmstat::NetworkInterface\n\t#\t    name=:p2p0,\n\t#\t    in_bytes=0,\n\t#\t    in_errors=0,\n\t#\t    in_drops=0,\n\t#\t    out_bytes=0,\n\t#\t    out_errors=0,\n\t#\t    type=6\u003e],\n\t#\t @task=\n\t#\t  #\u003cstruct Vmstat::Task\n\t#\t   suspend_count=0,\n\t#\t   virtual_size=2551554048,\n\t#\t   resident_size=19628032,\n\t#\t   user_time_ms=28,\n\t#\t   system_time_ms=83\u003e\u003e\n\n## Test\n\nDevelopment\n\n\tdocker-compose up\n\nSingle test build and run:\n\n\tdocker build -t ruby-vmstat .\n\tdocker run --rm -ti ruby-vmstat rake spec\n\n## Todo\n\n* Swap information\n* Support more platforms (hp ux, aix, ...)\n* Optimize performance for OpenBSD, NetBSD using `uvmexp` etc. directly\n* Optimize performance for solaris, smartos using `kstat` etc. directly\n* Server performance/system information (open file handles, cache sizes, number of inodes ...)\n\n## Contributing\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","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthreez%2Fruby-vmstat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthreez%2Fruby-vmstat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthreez%2Fruby-vmstat/lists"}