[JAVA-1322] Log command line friendly queries and milliseconds Created: 30/Jul/14 Updated: 08/Dec/17 Resolved: 08/Dec/17 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Monitoring |
| Affects Version/s: | 2.12.2 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Seshu Pasam | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | logging | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Description |
|
We use com.mongodo.TRACE occasionally to see the queries. Would like couple of improvements: |
| Comments |
| Comment by Jeffrey Yemin [ 08/Dec/17 ] |
|
I recently opened two very similar issues, so closing this one as a duplicate as I'd like to track this as two separate feature requests. |
| Comment by Seshu Pasam [ 30/Jul/14 ] |
|
Ross, thanks for your response. Yes, I am aware of and use mongo profiling. This is more for figuring out client side network latency issues etc, which cannot be see in profiling data. Since the driver is already logging the queries, it should be trivial to add this functionality. |
| Comment by Ross Lawley [ 30/Jul/14 ] |
|
Hi spasam, Did you know that mongodb has a profiler that will allow you to record this information? http://docs.mongodb.org/manual/tutorial/manage-the-database-profiler/ The profiler will record your queries in the manner required and the time taken for them to run. The profiler is configurable, you can set a time threshold for what queries get recorded - eg only record slow queries taking longer than 100ms. Profiling will have a minor impact on performance but it can be a great tool for helping tune your queries and indexes. The Java driver allows you to add a comment on a DBCursor that can be used to help trace queries in the profiler back to Java code should you need to. Does that meet your needs? Regards, Ross |