Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More informative help output for print-metrics #671

Merged
merged 2 commits into from
Jan 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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