demo.lua

changeset 0
813b739a632b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/demo.lua	Sun Feb 28 03:11:12 2010 +0000
@@ -0,0 +1,26 @@
+local stats = require "init";
+
+print("## Memory");
+print("Total:", stats.memory_total().." KB");
+print("Used:", stats.memory_used().." KB");
+print("Free:", stats.memory_free().." KB");
+
+print("");
+
+local disks = stats.disks();
+print("## Storage");
+for _, info in pairs(disks) do
+	print(info.mounted_on);
+	print("  Device:", info.device);
+	print("  Size:  ", info.total.." KB");
+	print("  Used:  ", info.used.." KB");
+	print("  Free:  ", info.free.." KB");
+end
+
+print("");
+
+local five, ten, fifteen = stats.load_average();
+print("## Load");
+print("Past 5 minutes: ", five);
+print("Past 10 minutes:", ten);
+print("Past 15 minutes:", fifteen);

mercurial