All Projects → threez → Ruby Vmstat

threez / Ruby Vmstat

Licence: mit
A focused and fast library to gather memory, cpu, network, load avg and disk information

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Ruby Vmstat

psutil
Cross-platform lib for process and system monitoring in Python
Stars: ✭ 8,488 (+12382.35%)
Mutual labels:  freebsd, cpu, openbsd, disk, netbsd
Qtfm
Qt File Manager
Stars: ✭ 73 (+7.35%)
Mutual labels:  macosx, freebsd, openbsd, netbsd
Persepolis
Persepolis Download Manager is a GUI for aria2.
Stars: ✭ 5,218 (+7573.53%)
Mutual labels:  macosx, freebsd, openbsd
Awesome Bsd
A collection of awesome BSD related stuff
Stars: ✭ 236 (+247.06%)
Mutual labels:  freebsd, openbsd, netbsd
WendzelNNTPd
A usable and IPv6-ready Usenet-server (NNTP daemon). It is portable (Linux/*BSD/*nix), supports AUTHINFO authentication, contains ACL as well as role based ACL and provides "invisible" newsgroups. It can run on MySQL and SQLite backends.
Stars: ✭ 43 (-36.76%)
Mutual labels:  freebsd, openbsd, netbsd
Ecominit
eComInit is a free init system and service manager designed to scale from lightweight desktops to web-scale cloud deployments. It aims to offer feature-parity with systemd but with a modular, portable architecture compliant with software engineering best-practice.
Stars: ✭ 352 (+417.65%)
Mutual labels:  freebsd, openbsd, netbsd
Daemonize
daemonize is a library for writing system daemons in Python.
Stars: ✭ 396 (+482.35%)
Mutual labels:  freebsd, openbsd, netbsd
InitKit
Neo-InitWare is a modular, cross-platform reimplementation of the systemd init system. It is experimental.
Stars: ✭ 364 (+435.29%)
Mutual labels:  freebsd, openbsd, netbsd
Libtuntap
The portable Tun/Tap devices configuration utility
Stars: ✭ 107 (+57.35%)
Mutual labels:  freebsd, openbsd, netbsd
gsmartcontrol
GSmartControl - Hard disk drive and SSD health inspection tool
Stars: ✭ 183 (+169.12%)
Mutual labels:  freebsd, openbsd, netbsd
Awesome-BSD-Ports-Programs-And-Projects
A Repo Detailing BSD Ports, Programs, and Projects.
Stars: ✭ 46 (-32.35%)
Mutual labels:  freebsd, openbsd, netbsd
Objfw
[Official Mirror] A portable framework for the Objective-C language.
Stars: ✭ 161 (+136.76%)
Mutual labels:  freebsd, openbsd, netbsd
Mg
Micro (GNU) Emacs-like text editor ❤️ public-domain
Stars: ✭ 117 (+72.06%)
Mutual labels:  freebsd, openbsd, netbsd
Cosmopolitan
build-once run-anywhere c library
Stars: ✭ 6,324 (+9200%)
Mutual labels:  freebsd, openbsd, netbsd
Fisy Fuzz
This is the full file system fuzzing framework that I presented at the Hack in the Box 2020 Lockdown Edition conference in April.
Stars: ✭ 110 (+61.76%)
Mutual labels:  freebsd, openbsd, netbsd
Awesome Unix
All the UNIX and UNIX-Like: Linux, BSD, macOS, Illumos, 9front, and more.
Stars: ✭ 973 (+1330.88%)
Mutual labels:  freebsd, openbsd, netbsd
Postinstall
💻 Bash Script to automate post-installation steps
Stars: ✭ 104 (+52.94%)
Mutual labels:  freebsd, openbsd, netbsd
uac
UAC is a Live Response collection script for Incident Response that makes use of native binaries and tools to automate the collection of AIX, Android, ESXi, FreeBSD, Linux, macOS, NetBSD, NetScaler, OpenBSD and Solaris systems artifacts.
Stars: ✭ 260 (+282.35%)
Mutual labels:  freebsd, openbsd, netbsd
osutil
Go library to easily detect current operating system, current Linux distribution, macOS version and more...
Stars: ✭ 22 (-67.65%)
Mutual labels:  freebsd, openbsd, netbsd
packetdrill
packetdrill with UDPLite and SCTP support and bug fixes for FreeBSD
Stars: ✭ 37 (-45.59%)
Mutual labels:  freebsd, openbsd, netbsd

Vmstat Build Status Code Climate

This is a focused and fast library to get system information like:

  • Memory (free, active, ...)
  • Network Interfaces (name, in bytes, out bytes, ...)
  • CPU (user, system, nice, idle)
  • Load Average
  • Disk (type, disk path, free bytes, total bytes, ...)
  • Boot Time
  • Current Task (used bytes and usage time MAC OS X / Linux ONLY)

It currently supports:

  • FreeBSD
  • MacOS X
  • Linux (>= 2.6)
  • OpenBSD
  • NetBSD
  • Solaris/SmartOS

It might support (but not tested):

  • Older versions of linux

Installation

Add this line to your application's Gemfile:

gem 'vmstat'

And then execute:

$ bundle

Or install it yourself as:

$ gem install vmstat

Usage

Just 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.

require "vmstat"

Vmstat.snapshot # => #<Vmstat::Snapshot:0x007fe5f22df660
#	 @at=2012-10-09 21:48:57 +0200,
#	 @boot_time=2012-10-09 18:42:37 +0200,
#	 @cpus=
#	  [#<struct Vmstat::Cpu
#	    num=0,
#	    user=187167,
#	    system=144466,
#	    nice=0,
#	    idle=786622>,
#	   #<struct Vmstat::Cpu num=1, user=2819, system=1641, nice=0, idle=1113782>,
#	   #<struct Vmstat::Cpu num=2, user=158698, system=95186, nice=0, idle=864359>,
#	   #<struct Vmstat::Cpu num=3, user=2702, system=1505, nice=0, idle=1114035>,
#	   #<struct Vmstat::Cpu num=4, user=140231, system=78248, nice=0, idle=899764>,
#	   #<struct Vmstat::Cpu num=5, user=2468, system=1314, nice=0, idle=1114460>,
#	   #<struct Vmstat::Cpu num=6, user=120764, system=66284, nice=0, idle=931195>,
#	   #<struct Vmstat::Cpu num=7, user=2298, system=1207, nice=0, idle=1114737>],
#	 @disks=
#	  [#<struct Vmstat::Disk
#	    type=:hfs,
#	    origin="/dev/disk0s2",
#	    mount="/",
#	    block_size=4096,
#	    free_blocks=51470668,
#	    available_blocks=51406668,
#	    total_blocks=61069442>],
#	 @load_average=
#	  #<struct Vmstat::LoadAverage
#	   one_minute=1.74072265625,
#	   five_minutes=1.34326171875,
#	   fifteen_minutes=1.1845703125>,
#	 @memory=
#	  #<struct Vmstat::Memory
#	   pagesize=4096,
#	   wired=1037969,
#	   active=101977,
#	   inactive=484694,
#	   free=470582,
#	   pageins=102438,
#	   pageouts=0>,
#	 @network_interfaces=
#	  [#<struct Vmstat::NetworkInterface
#	    name=:lo0,
#	    in_bytes=6209398,
#	    in_errors=0,
#	    in_drops=0,
#	    out_bytes=6209398,
#	    out_errors=0,
#	    type=24>,
#	   #<struct Vmstat::NetworkInterface
#	    name=:gif0,
#	    in_bytes=0,
#	    in_errors=0,
#	    in_drops=0,
#	    out_bytes=0,
#	    out_errors=0,
#	    type=55>,
#	   #<struct Vmstat::NetworkInterface
#	    name=:stf0,
#	    in_bytes=0,
#	    in_errors=0,
#	    in_drops=0,
#	    out_bytes=0,
#	    out_errors=0,
#	    type=57>,
#	   #<struct Vmstat::NetworkInterface
#	    name=:en0,
#	    in_bytes=1321276010,
#	    in_errors=0,
#	    in_drops=0,
#	    out_bytes=410426678,
#	    out_errors=0,
#	    type=6>,
#	   #<struct Vmstat::NetworkInterface
#	    name=:p2p0,
#	    in_bytes=0,
#	    in_errors=0,
#	    in_drops=0,
#	    out_bytes=0,
#	    out_errors=0,
#	    type=6>],
#	 @task=
#	  #<struct Vmstat::Task
#	   suspend_count=0,
#	   virtual_size=2551554048,
#	   resident_size=19628032,
#	   user_time_ms=28,
#	   system_time_ms=83>>

Todo

  • Swap information
  • Support more platforms (hp ux, aix, ...)
  • Optimize performance for OpenBSD, NetBSD using uvmexp etc. directly
  • Optimize performance for solaris, smartos using kstat etc. directly
  • Server performance/system information (open file handles, cache sizes, number of inodes ...)

Contributing

  1. Fork it
  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 new Pull Request
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].