We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b8d95a1 commit 8ab1e3bCopy full SHA for 8ab1e3b
2 files changed
README.md
@@ -17,7 +17,7 @@ This is a focused and fast library to get system information like:
17
* Linux (>= 2.6)
18
* OpenBSD
19
* NetBSD
20
-* Solaris/SmartOS (partially)
+* Solaris/SmartOS
21
22
*It might support (but not tested):*
23
lib/vmstat/solaris.rb
@@ -1,3 +1,5 @@
1
+require "time"
2
+
3
module Vmstat
4
def self.cpu
5
mpstat = `mpstat 1 1`.lines
@@ -8,6 +10,15 @@ def self.cpu
8
10
end
9
11
12
13
+ def self.boot_time
14
+ Time.parse(`who -b`.gsub(/^.*boot\s+/, "").gsub(/\s+/, " ").strip)
15
+ end
16
+ def self.load_average
+ uptime = `uptime`.gsub(",", ".")
+ LoadAverage.new(*uptime.gsub(/\d+(\.\d+)?/).to_a[-3..-1].map(&:to_f))
def self.memory
memstat = `echo ::memstat | mdb -k`
24
vmstat = `vmstat -s`
0 commit comments