Permalink
Browse files

Added more examples of usage

  • Loading branch information...
1 parent ec5fc57 commit d6fa623d31fef53168b677112d05048d2c5aa0f5 @zcaudate zcaudate committed Oct 12, 2012
View
@@ -213,6 +213,44 @@ It has wrappers for all the JMX Beans:
:waited-count 0, :lock-name nil, :lock-owner-id -1, :blocked-count 0, :thread-name "Swank Worker Thread", :waited-time -1}
+## More Examples
+
+Examples of how easy it is to build system diagnostic tools can be seen in the sigmund.commands directory. These commands are ported over from the `org.hyperic.sigar.cmd` package. See http://www.hyperic.com/support/docs/sigar/. When the code needed to generate these commands are compared, sigmund wins hands down.
+
+ (use 'sigmund.commands.df)
+ (print-df)
+ ;; =>
+ ; ==============================================================================
+ ; :fs | :total | :used | :free | :used-pct | :mounted | :type
+ ; ==============================================================================
+ ; /dev/disk0s1 | 196M | 15M | 181M | 8% | /Volumes/EFI | msdos/local
+ ; devfs | 110K | 110K | 0 | 100% | /dev | devfs/none
+ ; /dev/disk0s2 | 223G | 198G | 25G | 89% | / | hfs/local
+ ; ==============================================================================
+
+
+ (require '[sigmund.commands.free :as f])
+ (f/print-free)
+ ;; =>
+ ; ===========================================
+ ; :name | :total | :used | :free | :used-pct
+ ; ===========================================
+ ; Memory | 4096M | 4053M | 42M | 72.4%
+ ; Swap | 2G | 1G | 967M | 0.5%
+ ; ===========================================
+
+
+ (require '[sigmund.commands.cpu-load :as cl])
+ (cl/print-cpu-load)
+ ;; =>
+ ; =================================================================
+ ; :name | :user | :system | :wait | :nice | :irq | :total | :idle
+ ; =================================================================
+ ; AVERAGE | 59.7% | 9.1% | 0.0% | 0.0% | 0.0% | 68.8% | 31.2%
+ ; CPU 0 | 69.4% | 6.1% | 0.0% | 0.0% | 0.0% | 75.5% | 24.5%
+ ; CPU 1 | 50.0% | 12.0% | 0.0% | 0.0% | 0.0% | 62.0% | 38.0%
+ ; =================================================================
+
## License
Copyright © 2012 Chris Zheng
@@ -1,6 +1,6 @@
(ns sigmund.commands.cpu-load
(:use [sigmund.util :only [human-readable]])
- (:require [sigmund.sigar :as sig]
+ (:require [sigmund.core :as sig]
[clojure.pprint :as pp]))
(def ATTRIBUTES [:name :user :system :wait :nice :irq :total :idle])
@@ -1,6 +1,6 @@
(ns sigmund.commands.df
(:use [sigmund.util :only [up-shift human-readable]])
- (:require [sigmund.sigar :as sig]
+ (:require [sigmund.core :as sig]
[clojure.pprint :as pp]))
(def ATTRIBUTES [:fs :total :used :free :used-pct :mounted :type])
@@ -1,6 +1,6 @@
(ns sigmund.commands.free
(:use [sigmund.util :only [up-shift human-readable]])
- (:require [sigmund.sigar :as sig]
+ (:require [sigmund.core :as sig]
[clojure.pprint :as pp]))
(def ATTRIBUTES [:name :total :used :free :used-pct])
@@ -1,7 +1,7 @@
(ns sigmund.commands.netusage
(:import java.util.Date)
(:use [sigmund.util :only [human-readable]])
- (:require [sigmund.sigar :as sig]
+ (:require [sigmund.core :as sig]
[clojure.pprint :as pp]))
(def *network-status* (atom nil))

0 comments on commit d6fa623

Please sign in to comment.