Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-1000

Profiling/monitoring with Mongo::Protocol::Query#payload

    XMLWordPrintable

    Details

    • Type: Question
    • Status: Closed
    • Priority: Trivial - P5
    • Resolution: Fixed
    • Affects Version/s: 2.2.0
    • Fix Version/s: 12_01_17
    • Component/s: Public API
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible

      Description

      Currently the #payload method:

      https://github.com/mongodb/mongo-ruby-driver/blob/3d8f27fd689e01be409b52539f716fab987a7c19/lib/mongo/protocol/query.rb#L80

      Doesn't return the collection, as the deprecated and removed #log_message did.

      Is this intended? But either way:
      Is there a better place to hook some sort of monitoring code than Mongo::Protocol::Query ?

      As an example, two projects that do that (hook on Mongo::Protocol::Query):
      github Peek and RackMiniProfiler 'https://github.com/MiniProfiler/rack-mini-profiler'.
      The later mongo 1.x, the former moped. I'm currently trying to finish the support for RackMiniProfiler:

      https://github.com/MiniProfiler/rack-mini-profiler/pull/156
      https://github.com/nofxx/rack-mini-profiler/blob/master/lib/patches/db/mongo.rb

      Thanks you!

        Attachments

          Activity

            People

            Assignee:
            emily.stolfo Emily Stolfo
            Reporter:
            nofxx Marcos
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: