Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-1351

default output format for mongotape monitor incorrect

    • Type: Icon: New Feature New Feature
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.3.11, 3.3.14
    • Affects Version/s: None
    • Component/s: None
    • None

      The default format for "monitor" uses

       %F{green}%R{Response:}%f%r 

      to conditionally show the word "Response" (if there is response data) followed by the response itself.

      Running 'monitor' on a test file with the new formatting shows all the responses blank, even when it definitely has data:

      2/14 14:48:52.309 (Connection: 0:3489)  command ping admin.$cmd Request:{"ping":1}
      2/14 14:48:52.309 (Connection: 1:8503)  command ping admin.$cmd Request:{"ping":1}
      2/14 14:48:52.309 (Connection: 0:3489) +140µs reply    Response:
      2/14 14:48:52.309 (Connection: 1:8503) +97µs reply    Response:
      2/14 14:48:54.137 (Connection: 2:4)  command listCollections test.$cmd Request:{"listCollections":1.0}
      2/14 14:48:54.137 (Connection: 2:4) +306µs reply    Response:
      2/14 14:48:54.140 (Connection: 2:5)  command isMaster test.$cmd Request:{"forShell":1.0,"isMaster":1.0}
      2/14 14:48:54.140 (Connection: 2:5) +101µs reply    Response:
      2/14 14:48:57.317 (Connection: 2:6)  query  test.bar Request:{}
      2/14 14:48:57.318 (Connection: 2:6) +1.034ms reply    Response:
      2/14 14:48:57.320 (Connection: 2:7)  command isMaster test.$cmd Request:{"forShell":1.0,"isMaster":1.0}
      2/14 14:48:57.320 (Connection: 2:7) +190µs reply    Response:
      

      For some reason, changing the format to

       %F{green}%R{Response:}%r%f 

      (switching the order of the terminating %f and %r) makes the responses show up again, although they're in green instead of white.

      For reference, the old formatting code (@ e018396) on the same file produces this output:

      2/14 14:48:52.309 (Connection 0:3489) command ping admin.$cmd Request:{"ping":1}
      2/14 14:48:52.309 (Connection 1:8503) command ping admin.$cmd Request:{"ping":1}
      2/14 14:48:52.309 (Connection 0:3489) +140µs reply Request:{"ok":1.0}
      2/14 14:48:52.309 (Connection 1:8503) +97µs reply Request:{"ok":1.0}
      2/14 14:48:54.137 (Connection 2:4) command listCollections test.$cmd Request:{"listCollections":1.0}
      2/14 14:48:54.137 (Connection 2:4) +306µs reply Request:{"cursor":{"firstBatch":[{"name":"attendees","options":{}},{"name":"poop","options":{}},{"name":"flights201406","options":{}},{"name":"bson_dump","options":{}},{"name":"null...mple","options":{}},{"name":"evg","options":{}},{"name":"test1","options":{}},{"name":"r","options":{}}],"id":{"$numberLong":"0"},"ns":"test.$cmd.listCollections"},"ok":1.0}
      2/14 14:48:54.140 (Connection 2:5) command isMaster test.$cmd Request:{"forShell":1.0,"isMaster":1.0}
      2/14 14:48:54.140 (Connection 2:5) +101µs reply Request:{"ismaster":true,"localTime":{"$date":"2016-08-02T14:48:54.140Z"},"maxBsonObjectSize":16777216,"maxMessageSizeBytes":48000000,"maxWireVersion":5,"maxWriteBatchSize":1000,"minWireVersion":0,"ok":1.0,"readOnly":false}
      2/14 14:48:57.317 (Connection 2:6) query test.bar Request:{}
      2/14 14:48:57.318 (Connection 2:6) +1.034ms reply Request:{"_id":"5","a":6,"b":7}
      2/14 14:48:57.320 (Connection 2:7) command isMaster test.$cmd Request:{"forShell":1.0,"isMaster":1.0}
      2/14 14:48:57.320 (Connection 2:7) +190µs reply Request:{"ismaster":true,"localTime":{"$date":"2016-08-02T14:48:57.320Z"},"maxBsonObjectSize":16777216,"maxMessageSizeBytes":48000000,"maxWireVersion":5,"maxWriteBatchSize":1000,"minWireVersion":0,"ok":1.0,"readOnly":false}
      

            Assignee:
            lucas.morales Lucas Morales
            Reporter:
            mikeo@mongodb.com Michael O'Brien
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: