This is an automated email from the ASF dual-hosted git repository.

rzo1 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/storm.git


The following commit(s) were added to refs/heads/master by this push:
     new 939d92c6d Fix cli monitor component's argument type
939d92c6d is described below

commit 939d92c6db287db2b4e322bed8cf1a218bd2c49f
Author: Daniel Kimsey <[email protected]>
AuthorDate: Thu Nov 4 16:21:28 2021 -0500

    Fix cli monitor component's argument type
    
    The `component` value is a string, not a number, see 
[Monitor.java](https://github.com/apache/storm/blob/master/storm-core/src/jvm/org/apache/storm/utils/Monitor.java#L156).
    
    Attempting to use a number throws a stacktrace like such:
    
    ```
    ~/apache-storm-2.3.0/bin/storm monitor -m wordGenerator production-topology
    topology        component       parallelism     stream  time-diff ms    
emitted throughput (Kt/s)
    Available components for production-topology :
    ------------------
    __acker
    wordGenerator
    intermediateRanker
    counter
    finalRanker
    ------------------
    Exception in thread "main" java.lang.IllegalArgumentException: component: 
wordGeneratotor not found
            at org.apache.storm.utils.Monitor.metrics(Monitor.java:128)
            at org.apache.storm.utils.Monitor.metrics(Monitor.java:83)
            at org.apache.storm.command.Monitor$1.run(Monitor.java:53)
            at 
org.apache.storm.utils.NimbusClient.withConfiguredClient(NimbusClient.java:128)
            at 
org.apache.storm.utils.NimbusClient.withConfiguredClient(NimbusClient.java:117)
            at org.apache.storm.command.Monitor.main(Monitor.java:50)
    ```
---
 bin/storm.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/storm.py b/bin/storm.py
index 6d7374142..309a42671 100755
--- a/bin/storm.py
+++ b/bin/storm.py
@@ -1065,7 +1065,7 @@ def initialize_monitor_subcommand(subparsers):
         "-i", "--interval", type=check_positive, default=None,
         help="""By default, poll-interval is 4 seconds"""
     )
-    sub_parser.add_argument("-m", "--component", type=check_positive, 
default=None)
+    sub_parser.add_argument("-m", "--component", default=None)
     sub_parser.add_argument("-s", "--stream", default=None)
     sub_parser.add_argument("-w", "--watch", default=None)
     sub_parser.set_defaults(func=monitor)

Reply via email to