Skip to content

Commit

Permalink
gearman_top: add timeout parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
sni committed May 7, 2024
1 parent b91e292 commit cdc0177
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions tools/gearman_top.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ int main (int argc, char **argv) {
/*
* and parse command line
*/
while((opt = getopt(argc, argv, "qvVhH:s:i:b")) != -1) {
while((opt = getopt(argc, argv, "qvVhH:s:i:bt:")) != -1) {
switch(opt) {
case 'h': print_usage();
break;
Expand All @@ -82,6 +82,8 @@ int main (int argc, char **argv) {
break;
case 'i': opt_interval = atof(optarg) * 1000000;
break;
case 't': con_timeout = atoi(optarg);
break;
case 'b': opt_batch = GM_ENABLED;
break;
case '?': printf("Error - No such option: `%c'\n\n", optopt);
Expand Down Expand Up @@ -171,14 +173,15 @@ void print_version() {
void print_usage() {
printf("usage:\n");
printf("\n");
printf("gearman_top [ -H <hostname>[:port] ]\n");
printf(" [ -i <sec> seconds ]\n");
printf(" [ -q quiet mode ]\n");
printf(" [ -b batch mode ]\n");
printf("gearman_top [ -H <hostname>[:port] ]\n");
printf(" [ -i <sec> interval in seconds ]\n");
printf(" [ -t <sec> timeout in seconds ]\n");
printf(" [ -q quiet mode ]\n");
printf(" [ -b batch mode ]\n");
printf("\n");
printf(" [ -h print help ]\n");
printf(" [ -v verbose output ]\n");
printf(" [ -V print version ]\n");
printf(" [ -h print help ]\n");
printf(" [ -v verbose output ]\n");
printf(" [ -V print version ]\n");
printf("\n");

exit( EXIT_SUCCESS );
Expand Down

0 comments on commit cdc0177

Please sign in to comment.