Permalink
Browse files

various cli fixes for blog entry

git-svn-id: svn://svn.caucho.com/resin/trunk@8508 9c94448d-38f1-0310-a231-d98308ff1ebf
  • Loading branch information...
1 parent 2f492f6 commit b34bf6b4946d167bb1f656a3848e1595c1eb81c0 alex committed Oct 20, 2011
@@ -141,28 +141,31 @@ public String execute(long activeTime, long samplingRate, int depth)
final double sampleTicks = profile.getTicks();
double totalPercent = 0d;
- out.println(" % time |time self(s)| % sum | Method Call");
-
- for (ProfileEntry entry : entries) {
+ out.println(" ref# | % time |time self(s)| % sum | Method Call");
+ for (int i = 0; i < entries.length; i++) {
+ ProfileEntry entry = entries[i];
double timePercent = (double) 100 * (double) entry.getCount()
/ sampleTicks;
double selfPercent = (double) 100 * (double) entry.getCount()
/ totalTicks;
totalPercent += selfPercent;
- out.println(String.format("%10.3f | %10.3f | %10.3f | %s",
+ out.println(String.format(" %4d | %10.3f | %10.3f | %10.3f | %s",
+ i,
timePercent,
(float) entry.getCount() * samplingRate * 0.001,
totalPercent,
entry.getDescription()));
}
- for (ProfileEntry entry : entries) {
- out.println(entry.getDescription());
+ for (int i = 0; i < entries.length; i++) {
+ ProfileEntry entry = entries[i];
+ out.print(String.format(" %4d ", i));
+ out.println(" " + entry.getDescription());
ArrayList<? extends StackEntry> stackEntries = entry.getStackTrace();
for (StackEntry stackEntry : stackEntries) {
- out.println(" " + stackEntry.getDescription());
+ out.println(" " + stackEntry.getDescription());
}
}
}
@@ -125,12 +125,14 @@ public int doCommand(WatchdogArgs args,
@Override
public void usage()
{
- System.err.println(L.l("usage: bin/resin.sh [-conf <file>] deploy -user <user> -password <password> [options] <war-file>"));
+ System.err.println(L.l("usage: bin/resin.sh [-conf <file>] [-server <id>] deploy -user <user> -password <password> [options] <war-file>"));
System.err.println(L.l(""));
System.err.println(L.l("description:"));
System.err.println(L.l(" deploys application specified in a <war-file> to resin server"));
System.err.println(L.l(""));
System.err.println(L.l("options:"));
+ System.err.println(L.l(" -conf <file> : resin configuration file"));
+ System.err.println(L.l(" -server <id> : id of a server"));
System.err.println(L.l(" -address <address> : ip or host name of the server"));
System.err.println(L.l(" -port <port> : server http port"));
System.err.println(L.l(" -user <user> : user name used for authentication to the server"));
@@ -110,12 +110,14 @@ public int doCommand(WatchdogArgs args,
@Override
public void usage()
{
- System.err.println(L.l("usage: bin/resin.sh [-conf <file>] deploy-copy -user <user> -password <password> [options]"));
+ System.err.println(L.l("usage: bin/resin.sh [-conf <file>] [-server <id>] deploy-copy -user <user> -password <password> [options]"));
System.err.println(L.l(""));
System.err.println(L.l("description:"));
System.err.println(L.l(" copies a deployed application according to the given options"));
System.err.println(L.l(""));
System.err.println(L.l("options:"));
+ System.err.println(L.l(" -conf <file> : resin configuration file"));
+ System.err.println(L.l(" -server <id> : id of a server"));
System.err.println(L.l(" -address <address> : ip or host name of the server"));
System.err.println(L.l(" -port <port> : server http port"));
System.err.println(L.l(" -user <user> : user name used for authentication to the server"));
@@ -128,6 +130,6 @@ public void usage()
System.err.println(L.l(" -target-host <target-host> : target host"));
System.err.println(L.l(" -target-stage <target-stage> : target stage"));
System.err.println(L.l(" -target-version <target-version> : target version"));
- System.err.println(L.l(" -m <message> : commit message"));
+ System.err.println(L.l(" -m <message> : commit message"));
}
}
@@ -58,12 +58,14 @@ public int doCommand(WatchdogArgs args,
@Override
public void usage()
{
- System.err.println(L.l("usage: bin/resin.sh [-conf <file>] deploy-list -user <user> -password <password> [options] [pattern]"));
+ System.err.println(L.l("usage: bin/resin.sh [-conf <file>] [-server <id>] deploy-list -user <user> -password <password> [options] [pattern]"));
System.err.println(L.l(""));
System.err.println(L.l("description:"));
System.err.println(L.l(" lists all applications deployed on the server or those that match the [pattern]"));
System.err.println(L.l(""));
System.err.println(L.l("options:"));
+ System.err.println(L.l(" -conf <file> : resin configuration file"));
+ System.err.println(L.l(" -server <id> : id of a server"));
System.err.println(L.l(" -address <address> : ip or host name of the server"));
System.err.println(L.l(" -port <port> : server http port"));
}
@@ -59,12 +59,14 @@ protected int doCommand(WebAppDeployClient deployClient,
@Override
public void usage()
{
- System.err.println(L.l("usage: bin/resin.sh [-conf <file>] deploy-restart -user <user> -password <password> [options] <name>"));
+ System.err.println(L.l("usage: bin/resin.sh [-conf <file>] [-server <id>] deploy-restart -user <user> -password <password> [options] <name>"));
System.err.println(L.l(""));
System.err.println(L.l("description:"));
System.err.println(L.l(" restarts application context specified in a <name>"));
System.err.println(L.l(""));
System.err.println(L.l("options:"));
+ System.err.println(L.l(" -conf <file> : resin configuration file"));
+ System.err.println(L.l(" -server <id> : id of a server"));
System.err.println(L.l(" -address <address> : ip or host name of the server"));
System.err.println(L.l(" -port <port> : server http port"));
System.err.println(L.l(" -user <user> : user name used for authentication to the server"));
@@ -59,12 +59,14 @@ protected int doCommand(WebAppDeployClient deployClient,
@Override
public void usage()
{
- System.err.println(L.l("usage: bin/resin.sh [-conf <file>] deploy-start -user <user> -password <password> [options] <name>"));
+ System.err.println(L.l("usage: bin/resin.sh [-conf <file>] [-server <id>] deploy-start -user <user> -password <password> [options] <name>"));
System.err.println(L.l(""));
System.err.println(L.l("description:"));
System.err.println(L.l(" starts application context specified in a <name>"));
System.err.println(L.l(""));
System.err.println(L.l("options:"));
+ System.err.println(L.l(" -conf <file> : resin configuration file"));
+ System.err.println(L.l(" -server <id> : id of a server"));
System.err.println(L.l(" -address <address> : ip or host name of the server"));
System.err.println(L.l(" -port <port> : server http port"));
System.err.println(L.l(" -user <user> : user name used for authentication to the server"));
@@ -59,12 +59,14 @@ protected int doCommand(WebAppDeployClient deployClient,
@Override
public void usage()
{
- System.err.println(L.l("usage: bin/resin.sh [-conf <file>] deploy-stop -user <user> -password <password> [options] <name>"));
+ System.err.println(L.l("usage: bin/resin.sh [-conf <file>] [-server <id>] deploy-stop -user <user> -password <password> [options] <name>"));
System.err.println(L.l(""));
System.err.println(L.l("description:"));
System.err.println(L.l(" stop application context specified in a <name>"));
System.err.println(L.l(""));
System.err.println(L.l("options:"));
+ System.err.println(L.l(" -conf <file> : resin configuration file"));
+ System.err.println(L.l(" -server <id> : id of a server"));
System.err.println(L.l(" -address <address> : ip or host name of the server"));
System.err.println(L.l(" -port <port> : server http port"));
System.err.println(L.l(" -user <user> : user name used for authentication to the server"));
@@ -57,12 +57,18 @@ public int doCommand(WatchdogArgs args,
@Override
public void usage()
{
- System.err.println(L.l("usage: bin/resin.sh [-conf <file>] heap-dump -user <user> -password <password> [-raw]"));
+ System.err.println(L.l("usage: bin/resin.sh [-conf <file>] [-server <id>] heap-dump [-address <address>] [-port <port>] -user <user> -password <password> [-raw]"));
System.err.println(L.l(""));
System.err.println(L.l("description:"));
System.err.println(L.l(" prints heap summary taken on remote server"));
System.err.println(L.l(""));
System.err.println(L.l("options:"));
- System.err.println(L.l(" -raw : creates an hprof file"));
+ System.err.println(L.l(" -conf <file> : resin configuration file"));
+ System.err.println(L.l(" -server <id> : id of a server"));
+ System.err.println(L.l(" -address <address> : ip or host name of the server"));
+ System.err.println(L.l(" -port <port> : server http port"));
+ System.err.println(L.l(" -user <user> : user name used for authentication to the server"));
+ System.err.println(L.l(" -password <password> : password used for authentication to the server"));
+ System.err.println(L.l(" -raw : creates an hprof file"));
}
}
@@ -67,14 +67,20 @@ public int doCommand(WatchdogArgs args,
@Override
public void usage()
{
- System.err.println(L.l("usage: bin/resin.sh [-conf <file>] profile -user <user> -password <password> [-active-time <time>] [-sampling-rate <rate>] [-depth <depth>]"));
+ System.err.println(L.l("usage: bin/resin.sh [-conf <file>] [-server <id>] profile [-address <address>] [-port <port>] -user <user> -password <password> [-active-time <time>] [-sampling-rate <rate>] [-depth <depth>]"));
System.err.println(L.l(""));
System.err.println(L.l("description:"));
- System.err.println(L.l(" activates resin internal provider (Pro version only)"));
+ System.err.println(L.l(" activates resin internal profiler (Pro version only)"));
System.err.println(L.l(""));
System.err.println(L.l("options:"));
- System.err.println(L.l(" -active-time : specifies profiling time span in ms (defaults to 5000 - 5 sec.)" ));
- System.err.println(L.l(" -sampling-rate : specifies sampling rate (defaults to 10ms)"));
- System.err.println(L.l(" -depth : specifies stack trace depth (use smaller number (8) for smaller impact, larger – for more information). Defauts to 16."));
+ System.err.println(L.l(" -conf <file> : resin configuration file"));
+ System.err.println(L.l(" -server <id> : id of a server"));
+ System.err.println(L.l(" -address <address> : ip or host name of the server"));
+ System.err.println(L.l(" -port <port> : server http port"));
+ System.err.println(L.l(" -user <user> : user name used for authentication to the server"));
+ System.err.println(L.l(" -password <password> : password used for authentication to the server"));
+ System.err.println(L.l(" -active-time : specifies profiling time span in ms (defaults to 5000 - 5 sec.)" ));
+ System.err.println(L.l(" -sampling-rate : specifies sampling rate (defaults to 10ms)"));
+ System.err.println(L.l(" -depth : specifies stack trace depth (use smaller number (8) for smaller impact, larger – for more information). Defauts to 16."));
}
}
@@ -112,7 +112,6 @@ public void usage()
System.out.println(" -log-directory <dir> : select a logging directory");
System.out.println(" -resin-home <dir> : select a resin home directory");
System.out.println(" -root-directory <dir> : select a root directory");
- System.out.println(" -server <id> : select a <server> to run");
System.out.println(" -watchdog-port <port> : override the watchdog-port");
System.out.println(" -verbose : print verbose starting information");
}
@@ -84,13 +84,18 @@ public int doCommand(WatchdogArgs args,
public void usage()
{
System.err.println(L.l(
- "usage: bin/resin.sh [-conf <file>] thread-dump -user <user> -password <password> [-file <file>]"));
+ "usage: bin/resin.sh [-conf <file>] [-server <id>] thread-dump [-address <address>] [-port <port>] -user <user> -password <password> [-file <file>]"));
System.err.println(L.l(""));
System.err.println(L.l("description:"));
System.err.println(L.l(" prints a thread dump taken on remote server"));
System.err.println(L.l(""));
System.err.println(L.l("options:"));
- System.err.println(L.l(
- " -file <file> : file name where thread dump will be stored"));
+ System.err.println(L.l(" -conf <file> : resin configuration file"));
+ System.err.println(L.l(" -server <id> : id of a server"));
+ System.err.println(L.l(" -address <address> : ip or host name of the server"));
+ System.err.println(L.l(" -port <port> : server http port"));
+ System.err.println(L.l(" -user <user> : user name used for authentication to the server"));
+ System.err.println(L.l(" -password <password> : password used for authentication to the server"));
+ System.err.println(L.l(" -file <file> : file name where thread dump will be stored"));
}
}
@@ -95,12 +95,14 @@ public int doCommand(WatchdogArgs args,
@Override
public void usage()
{
- System.err.println(L.l("usage: bin/resin.sh [-conf <file>] undeploy -user <user> -password <password> [options] <name>"));
+ System.err.println(L.l("usage: bin/resin.sh [-conf <file>] [-server <id>] undeploy -user <user> -password <password> [options] <name>"));
System.err.println(L.l(""));
System.err.println(L.l("description:"));
System.err.println(L.l(" undeploys application specified in a <name>"));
System.err.println(L.l(""));
System.err.println(L.l("options:"));
+ System.err.println(L.l(" -conf <file> : resin configuration file"));
+ System.err.println(L.l(" -server <id> : id of a server"));
System.err.println(L.l(" -address <address> : ip or host name of the server"));
System.err.println(L.l(" -port <port> : server http port"));
System.err.println(L.l(" -host <host> : virtual host to make application available on"));

0 comments on commit b34bf6b

Please sign in to comment.