diff options
author | jestin | 2002-03-06 12:56:54 +0000 |
---|---|---|
committer | jestin | 2002-03-06 12:56:54 +0000 |
commit | cb0e14bbd6882bed96642628ddc5e6d9c6c8baa4 (patch) | |
tree | fc48c04882b586400610f832d759279f8cad007d /src/Probe.java | |
parent | bdc113909fc711ce7c411d04a1f63c86d1b6c0d0 (diff) | |
download | ivy-java-cb0e14bbd6882bed96642628ddc5e6d9c6c8baa4.zip ivy-java-cb0e14bbd6882bed96642628ddc5e6d9c6c8baa4.tar.gz ivy-java-cb0e14bbd6882bed96642628ddc5e6d9c6c8baa4.tar.bz2 ivy-java-cb0e14bbd6882bed96642628ddc5e6d9c6c8baa4.tar.xz |
Counter counts an approximative number of messages going on the bus,
think xload, but for ivy messages. 1 second, 10 seconds, 1 minute
Diffstat (limited to 'src/Probe.java')
-rw-r--r-- | src/Probe.java | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/Probe.java b/src/Probe.java index 6e4543b..a5238c1 100644 --- a/src/Probe.java +++ b/src/Probe.java @@ -1,6 +1,6 @@ package fr.dgac.ivy ; -import gnu.getopt.Getopt; import java.io.*; +import gnu.getopt.Getopt; /** * terminal implementation in java of the ivyprobe. @@ -12,9 +12,14 @@ import java.io.*; */ class Probe implements IvyApplicationListener, IvyMessageListener { + /** + * help message for the standalone program + */ + public static final String helpmsg = "usage: java fr.dgac.ivy.Probe [options] [regexp]\n\t-b BUS\tspecifies the Ivy bus domain\n\t-q\tquiet, no tty output\n\t-d\tdebug\n\t-h\thelp\n\n\t regexp is a Perl5 compatible regular expression"; + public static void main(String[] args) throws IvyException { Probe p = new Probe(); - Getopt opt = new Getopt("Probe",args,"b:d"); + Getopt opt = new Getopt("Probe",args,"b:dh"); int c; String domain=Ivy.getDomain(null); while ((c = opt.getopt()) != -1) switch (c) { @@ -24,12 +29,14 @@ class Probe implements IvyApplicationListener, IvyMessageListener { case 'd': System.setProperty("IVY_DEBUG","yes"); break; + case 'h': default: + System.out.println(helpmsg); + System.exit(0); } // connexion to the Bus - Ivy bus; try { - bus=new Ivy("JPROBE","JPROBE ready",p); + Ivy bus=new Ivy("JPROBE","JPROBE ready",p); for (int i=opt.getOptind();i<args.length;i++) { System.out.println("you want to subscribe to " + args[i]); bus.bindMsg(args[i],p); @@ -69,7 +76,7 @@ class Probe implements IvyApplicationListener, IvyMessageListener { public void die(IvyClient client, int id) { looping=false; - System.out.println(client.getApplicationName() + " received die msg from "+ id ); + System.out.println("received die msg from " + client.getApplicationName() ); } public void directMessage(IvyClient client, int id, String arg) { |