Skip to content

Commit

Permalink
More informative help output for print-metrics (#671)
Browse files Browse the repository at this point in the history
* More informative help output for print-metrics

* Fix style check
  • Loading branch information
rodesai authored Jan 30, 2018
1 parent e8e930a commit 43e75ce
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 7 deletions.
14 changes: 10 additions & 4 deletions bin/ksql-print-metrics
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,25 @@

: "${JAVA_HOME:=""}"

function find_java_home {
local system=$(uname -s)
if (( $system == "Darwin" )); then
echo $(/usr/libexec/java_home)
fi
}

# Which java to use
if [ -z "$JAVA_HOME" ]; then
JAVA="java"
else
JAVA="$JAVA_HOME/bin/java"
JAVA_HOME=$(find_java_home)
fi

if [ -z "$JAVA_HOME" ]; then
echo "Please set JAVA_HOME to path to jdk installation directory"
echo "Could not find java home. Please set JAVA_HOME to path to jdk installation directory"
exit 1
fi

KSQL_CLASSPATH="$JAVA_HOME/lib/*"
JAVA="$JAVA_HOME/bin/java"

base_dir=$( cd -P "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,24 @@ public class PrintMetrics {

public static void printHelp() {
System.err.println(
"usage: PrintMetrics "
+ "[help] "
+ "pid=<KSQL PID>");
"usage: PrintMetrics [help] pid=<KSQL PID>\n" +
"\n" +
"This utility prints the following operational metrics tracked by ksql:\n" +
"\n" +
"messages-consumed-per-sec: Messages consumed per second across all queries\n" +
"messages-consumed-avg: The average number of messages consumed by a query " +
"per second\n" +
"messages-consumed-min: Messages consumed per second for the query with the " +
"fewest messages consumed per second\n" +
"messages-consumed-max: Messages consumed per second for the query with the " +
"most messages consumed per second\n" +
"messages-produced-per-sec: Messages produced per second across all queries\n" +
"error-rate: The number of messages which were consumed but not " +
" processed across all queries\n" +
"num-persistent-queries: The number of queries currently executing.\n" +
"num-active-queries: The number of queries actively processing messages.\n" +
"num-idle-queries: The number of queries with no messages available to " +
"process.");
}

private static void printMetrics(int pid) throws IOException {
Expand Down

0 comments on commit 43e75ce

Please sign in to comment.