Skip to Main Content

MongoByte MongoDB Logo

Welcome to the new MongoDB Feedback Portal!

{Improvement: "Your idea"}
We’ve upgraded our system to better capture and act on your feedback.
Your feedback is meaningful and helps us build better products.

Status Submitted
Categories Database
Created by Guest
Created on May 8, 2023

Expose individual command execution time

Many MongoDB drivers currently expose events (CommandSucceededEvent say) which provide an elapsed time. However, that elapsed time is the round-trip time, which is not super useful as that can be measured by a programmer manually. It would be neat if there was a way to get the actual time spent *by the server* on a per-command basis. This data is computed somewhere as it is exposed in Atlas metrics as Execution Time. There's the explain facility but this is just to get an estimate of a query's cost. I would be interested in knowing how much time the server spent running an actual command. Latency could then be computed by subtracting this value from the round-trip time.
  • Attach files