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

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

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Trivial - P5 Trivial - P5
    • 12_01_17
    • Affects Version/s: 2.2.0
    • Component/s: Public API
    • None
    • Fully Compatible

      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!

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

              Created:
              Updated:
              Resolved: