From a54d202fe18d73d32701fc935c2eb04f965b4600 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sat, 24 Jul 2004 00:29:56 +0000 Subject: [PATCH] more doc --- bindings/java/.sigar_shellrc | 3 +++ bindings/java/src/net/hyperic/sigar/cmd/CpuInfo.java | 3 +++ bindings/java/src/net/hyperic/sigar/cmd/Df.java | 3 +++ bindings/java/src/net/hyperic/sigar/cmd/Free.java | 3 +++ bindings/java/src/net/hyperic/sigar/cmd/Ifconfig.java | 3 +++ bindings/java/src/net/hyperic/sigar/cmd/Kill.java | 3 +++ bindings/java/src/net/hyperic/sigar/cmd/Netstat.java | 5 ++++- bindings/java/src/net/hyperic/sigar/cmd/PTQL.java | 4 ++++ .../java/src/net/hyperic/sigar/cmd/ProcFileInfo.java | 3 +++ .../java/src/net/hyperic/sigar/cmd/ProcModuleInfo.java | 3 +++ bindings/java/src/net/hyperic/sigar/cmd/Ps.java | 3 +++ bindings/java/src/net/hyperic/sigar/cmd/ShowArgs.java | 3 +++ bindings/java/src/net/hyperic/sigar/cmd/ShowEnv.java | 3 +++ bindings/java/src/net/hyperic/sigar/cmd/Tail.java | 3 +++ bindings/java/src/net/hyperic/sigar/cmd/Top.java | 9 ++++++++- bindings/java/src/net/hyperic/sigar/cmd/Uptime.java | 5 ++++- bindings/java/src/net/hyperic/sigar/cmd/Version.java | 3 +++ bindings/java/src/net/hyperic/sigar/cmd/Watch.java | 3 +++ 18 files changed, 62 insertions(+), 3 deletions(-) diff --git a/bindings/java/.sigar_shellrc b/bindings/java/.sigar_shellrc index 32396959..0619a071 100644 --- a/bindings/java/.sigar_shellrc +++ b/bindings/java/.sigar_shellrc @@ -23,3 +23,6 @@ alias myag ptql CredName.User.eq=$user.name,State.Name.eq=java,Args.-1.ew=Spider #find all java procs except the shell itself #($$ is the current process id) alias java ptql State.Name.eq=java,Pid.Pid.ne=$$ + +#find all processes owned by the current user +alias myproc ptql CredName.User.eq=$user.name diff --git a/bindings/java/src/net/hyperic/sigar/cmd/CpuInfo.java b/bindings/java/src/net/hyperic/sigar/cmd/CpuInfo.java index 2fd0982b..7ec745e7 100644 --- a/bindings/java/src/net/hyperic/sigar/cmd/CpuInfo.java +++ b/bindings/java/src/net/hyperic/sigar/cmd/CpuInfo.java @@ -3,6 +3,9 @@ package net.hyperic.sigar.cmd; import net.hyperic.sigar.CpuPerc; import net.hyperic.sigar.SigarException; +/** + * Display cpu information for each cpu found on the system. + */ public class CpuInfo extends SigarCommandBase { public CpuInfo(Shell shell) { diff --git a/bindings/java/src/net/hyperic/sigar/cmd/Df.java b/bindings/java/src/net/hyperic/sigar/cmd/Df.java index d22360e1..26981caf 100644 --- a/bindings/java/src/net/hyperic/sigar/cmd/Df.java +++ b/bindings/java/src/net/hyperic/sigar/cmd/Df.java @@ -11,6 +11,9 @@ import net.hyperic.sigar.FileSystemUsage; import net.hyperic.sigar.shell.FileCompleter; import net.hyperic.sigar.util.GetlineCompleter; +/** + * Report filesytem disk space usage. + */ public class Df extends SigarCommandBase { private static final String OUTPUT_FORMAT = diff --git a/bindings/java/src/net/hyperic/sigar/cmd/Free.java b/bindings/java/src/net/hyperic/sigar/cmd/Free.java index f8c12d9c..044e49a5 100644 --- a/bindings/java/src/net/hyperic/sigar/cmd/Free.java +++ b/bindings/java/src/net/hyperic/sigar/cmd/Free.java @@ -4,6 +4,9 @@ import net.hyperic.sigar.Mem; import net.hyperic.sigar.Swap; import net.hyperic.sigar.SigarException; +/** + * Display amount of free and used memory in the system. + */ public class Free extends SigarCommandBase { public Free(Shell shell) { diff --git a/bindings/java/src/net/hyperic/sigar/cmd/Ifconfig.java b/bindings/java/src/net/hyperic/sigar/cmd/Ifconfig.java index bc3142d9..9247557c 100644 --- a/bindings/java/src/net/hyperic/sigar/cmd/Ifconfig.java +++ b/bindings/java/src/net/hyperic/sigar/cmd/Ifconfig.java @@ -9,6 +9,9 @@ import net.hyperic.sigar.NetInterfaceConfig; import net.hyperic.sigar.NetInterfaceStat; import net.hyperic.sigar.NetFlags; +/** + * Display network interface configuration and metrics. + */ public class Ifconfig extends SigarCommandBase { public Ifconfig(Shell shell) { diff --git a/bindings/java/src/net/hyperic/sigar/cmd/Kill.java b/bindings/java/src/net/hyperic/sigar/cmd/Kill.java index 69c0d8ad..f66c5bd4 100644 --- a/bindings/java/src/net/hyperic/sigar/cmd/Kill.java +++ b/bindings/java/src/net/hyperic/sigar/cmd/Kill.java @@ -2,6 +2,9 @@ package net.hyperic.sigar.cmd; import net.hyperic.sigar.SigarException; +/** + * Send a signal to a process. + */ public class Kill extends SigarCommandBase { public Kill(Shell shell) { diff --git a/bindings/java/src/net/hyperic/sigar/cmd/Netstat.java b/bindings/java/src/net/hyperic/sigar/cmd/Netstat.java index 8fa3f06e..63a9946d 100644 --- a/bindings/java/src/net/hyperic/sigar/cmd/Netstat.java +++ b/bindings/java/src/net/hyperic/sigar/cmd/Netstat.java @@ -5,6 +5,9 @@ import net.hyperic.sigar.SigarException; import net.hyperic.sigar.NetConnection; import net.hyperic.sigar.NetFlags; +/** + * Display network connections. + */ public class Netstat extends SigarCommandBase { public Netstat(Shell shell) { @@ -20,7 +23,7 @@ public class Netstat extends SigarCommandBase { } public String getUsageShort() { - return "Show network connections"; + return "Display network connections"; } //poor mans getopt. diff --git a/bindings/java/src/net/hyperic/sigar/cmd/PTQL.java b/bindings/java/src/net/hyperic/sigar/cmd/PTQL.java index 41c8a653..694527fb 100644 --- a/bindings/java/src/net/hyperic/sigar/cmd/PTQL.java +++ b/bindings/java/src/net/hyperic/sigar/cmd/PTQL.java @@ -22,6 +22,10 @@ import net.hyperic.sigar.shell.ShellCommandInitException; import net.hyperic.sigar.shell.ShellCommandHandler; import net.hyperic.sigar.shell.ShellCommandUsageException; +/** + * Run process table queries. + * @see net.hyperic.sigar.ptql.ProcessQueryBuilder + */ public class PTQL extends MultiwordShellCommand implements GetlineCompleter { diff --git a/bindings/java/src/net/hyperic/sigar/cmd/ProcFileInfo.java b/bindings/java/src/net/hyperic/sigar/cmd/ProcFileInfo.java index d6eaba41..f51028d7 100644 --- a/bindings/java/src/net/hyperic/sigar/cmd/ProcFileInfo.java +++ b/bindings/java/src/net/hyperic/sigar/cmd/ProcFileInfo.java @@ -5,6 +5,9 @@ import net.hyperic.sigar.SigarException; import net.hyperic.sigar.ProcFd; import net.hyperic.sigar.ProcExe; +/** + * Display process file information. + */ public class ProcFileInfo extends SigarCommandBase { public ProcFileInfo(Shell shell) { diff --git a/bindings/java/src/net/hyperic/sigar/cmd/ProcModuleInfo.java b/bindings/java/src/net/hyperic/sigar/cmd/ProcModuleInfo.java index a7db0925..07edaebb 100644 --- a/bindings/java/src/net/hyperic/sigar/cmd/ProcModuleInfo.java +++ b/bindings/java/src/net/hyperic/sigar/cmd/ProcModuleInfo.java @@ -6,6 +6,9 @@ import net.hyperic.sigar.Sigar; import net.hyperic.sigar.SigarException; import net.hyperic.sigar.SigarNotImplementedException; +/** + * Display process module info. + */ public class ProcModuleInfo extends SigarCommandBase { public ProcModuleInfo(Shell shell) { diff --git a/bindings/java/src/net/hyperic/sigar/cmd/Ps.java b/bindings/java/src/net/hyperic/sigar/cmd/Ps.java index 202e9b13..fc4fcebe 100644 --- a/bindings/java/src/net/hyperic/sigar/cmd/Ps.java +++ b/bindings/java/src/net/hyperic/sigar/cmd/Ps.java @@ -14,6 +14,9 @@ import java.util.List; import java.text.SimpleDateFormat; import java.util.Date; +/** + * Show process status. + */ public class Ps extends SigarCommandBase { public Ps(Shell shell) { diff --git a/bindings/java/src/net/hyperic/sigar/cmd/ShowArgs.java b/bindings/java/src/net/hyperic/sigar/cmd/ShowArgs.java index adb21b4e..abfa3ec1 100644 --- a/bindings/java/src/net/hyperic/sigar/cmd/ShowArgs.java +++ b/bindings/java/src/net/hyperic/sigar/cmd/ShowArgs.java @@ -3,6 +3,9 @@ package net.hyperic.sigar.cmd; import net.hyperic.sigar.SigarException; import net.hyperic.sigar.SigarNotImplementedException; +/** + * Show process command line arguments. + */ public class ShowArgs extends SigarCommandBase { public ShowArgs(Shell shell) { diff --git a/bindings/java/src/net/hyperic/sigar/cmd/ShowEnv.java b/bindings/java/src/net/hyperic/sigar/cmd/ShowEnv.java index 09cb6c34..c0cf96c8 100644 --- a/bindings/java/src/net/hyperic/sigar/cmd/ShowEnv.java +++ b/bindings/java/src/net/hyperic/sigar/cmd/ShowEnv.java @@ -5,6 +5,9 @@ import java.util.Iterator; import net.hyperic.sigar.SigarException; +/** + * Show process environment. + */ public class ShowEnv extends SigarCommandBase { public ShowEnv(Shell shell) { diff --git a/bindings/java/src/net/hyperic/sigar/cmd/Tail.java b/bindings/java/src/net/hyperic/sigar/cmd/Tail.java index 9d96ae30..de099156 100644 --- a/bindings/java/src/net/hyperic/sigar/cmd/Tail.java +++ b/bindings/java/src/net/hyperic/sigar/cmd/Tail.java @@ -10,6 +10,9 @@ import net.hyperic.sigar.FileInfo; import net.hyperic.sigar.FileTail; import net.hyperic.sigar.FileWatcherThread; +/** + * Display the last part of files to the standard output. + */ public class Tail { public static void main(String[] args) throws SigarException { diff --git a/bindings/java/src/net/hyperic/sigar/cmd/Top.java b/bindings/java/src/net/hyperic/sigar/cmd/Top.java index 29b1e17c..880b3e9b 100644 --- a/bindings/java/src/net/hyperic/sigar/cmd/Top.java +++ b/bindings/java/src/net/hyperic/sigar/cmd/Top.java @@ -10,8 +10,15 @@ import net.hyperic.sigar.ProcCpu; import net.hyperic.sigar.CurrentProcessSummary; /** - * Example:
+ * Display system resource utilization summaries and process information. + *

+ * This version of the top command requires a ptql query to select which + * processes to display. + * + * Example to display java processes only:
* % java -jar sigar-bin/lib/sigar.jar Top State.Name.eq=java + * + * @see net.hyperic.sigar.ptql.ProcessQueryBuilder */ public class Top { private static final int SLEEP_TIME = 1000 * 5; diff --git a/bindings/java/src/net/hyperic/sigar/cmd/Uptime.java b/bindings/java/src/net/hyperic/sigar/cmd/Uptime.java index 4b48100a..d9ac63bc 100644 --- a/bindings/java/src/net/hyperic/sigar/cmd/Uptime.java +++ b/bindings/java/src/net/hyperic/sigar/cmd/Uptime.java @@ -8,6 +8,9 @@ import net.hyperic.sigar.util.PrintfFormat; import java.text.SimpleDateFormat; import java.util.Date; +/** + * Display how long the system has been running and the current load averages. + */ public class Uptime extends SigarCommandBase { private static Object[] loadAvg = new Object[3]; @@ -24,7 +27,7 @@ public class Uptime extends SigarCommandBase { } public String getUsageShort() { - return "Show how long the system has been running"; + return "Display how long the system has been running"; } public void output(String[] args) throws SigarException { diff --git a/bindings/java/src/net/hyperic/sigar/cmd/Version.java b/bindings/java/src/net/hyperic/sigar/cmd/Version.java index f610ee91..4f7e35ba 100644 --- a/bindings/java/src/net/hyperic/sigar/cmd/Version.java +++ b/bindings/java/src/net/hyperic/sigar/cmd/Version.java @@ -7,6 +7,9 @@ import java.net.UnknownHostException; import net.hyperic.sigar.Sigar; import net.hyperic.sigar.SigarException; +/** + * Display Sigar, java and system version information. + */ public class Version extends SigarCommandBase { private static String[] SYS_PROPS = { "os.name", diff --git a/bindings/java/src/net/hyperic/sigar/cmd/Watch.java b/bindings/java/src/net/hyperic/sigar/cmd/Watch.java index 6a96b29a..7cea6000 100644 --- a/bindings/java/src/net/hyperic/sigar/cmd/Watch.java +++ b/bindings/java/src/net/hyperic/sigar/cmd/Watch.java @@ -12,6 +12,9 @@ import net.hyperic.sigar.FileInfo; import net.hyperic.sigar.FileWatcher; import net.hyperic.sigar.FileWatcherThread; +/** + * Watch a file or directory displaying attribute changes. + */ public class Watch { private static void printHeader(Sigar sigar, FileInfo info)