Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-3737

Patch to make qpid-stat -L option work

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.12
    • 0.15
    • C++ Tools

    Description

      Current behaviour:

      qpid -qIS queue         // Shows up to 50 queues.
      qpid -qIS queue -L 0    // Shows as many queues as possible (ie no limit).
      qpid -qIS queue -L 1    // Shows as many queues as possible (ie no limit).
      qpid -qIS queue -L 10   // Shows as many queues as possible (ie no limit).
      qpid -qIS queue -L 100  // Shows as many queues as possible (ie no limit).
      qpid -qIS queue -L blah // Shows as many queues as possible (ie no limit).
      

      This happens because:

      1. the default limit is 50, and
      2. the limit argument is read as a string, but compared to an int in the Sorter constructor - a comparison that always fails.

      Behaviour after the near-trivial attached patch:

      qpid -qIS queue         // Shows up to 50 queues.
      qpid -qIS queue -L 0    // Shows as many queues as possible (ie no limit).
      qpid -qIS queue -L 1    // Shows up to 1 queue.
      qpid -qIS queue -L 10   // Shows up to 10 queues.
      qpid -qIS queue -L 100  // Shows up to 100 queues.
      qpid -qIS queue -L blah // qpid-stat: error: option -L: invalid integer value: 'foo'
      

      I'll attach the patch, but's for the impatient

      Index: qpid-stat
      ===================================================================
      --- qpid-stat   (revision 1229483)
      +++ qpid-stat   (working copy)
      @@ -70,7 +70,7 @@
                         help="Sort by column name")
           group2.add_option("-I", "--increasing", action="store_true", default=False,
                         help="Sort by increasing value (default = decreasing)")
      -    group2.add_option("-L", "--limit", default=50, metavar="<n>",
      +    group2.add_option("-L", "--limit", type="int", default=50, metavar="<n>",
                         help="Limit output to n rows")
           group2.add_option("-C", "--cluster", action="store_true", default=False,
                         help="Display per-broker cluster detail.")
      

      Attachments

        1. qpid-stat.diff
          0.7 kB
          Paul Colby

        Activity

          People

            tross Ted Ross
            pcolby Paul Colby
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified