MongoDB support


#1

Please add support for MongoDB


#2

How do you envisage this working?


#3

I suppose one can dig into the MongoDB C# driver and make something like ProfiledDbConnection but for MongoDB. Timing wouldn’t be too hard (do it client side if the server doesn’t say the query execution time) and the query is trivially to get, probably stored in a string.

I won’t have time until next months to try to get something working, but it shouldn’t be too hard.


#4

I have been just wrapping my MongoDB calls with a .Step() but it would be great to get this timing for free like I do for SQL. It would be great to see details of what I’m querying on, but even just query executing time and a summed up time spent in Mongo would be super helpful.


#5

I created a fork with simultaneous Mongo and SQL support. It is far from complete, but should get you started.
https://github.com/brycekahle/MiniProfiler


#6

@Bryce do you feel like giving the prep “abstraction” work a shot? Keep in mind we already have an interface for profiling.


#7

how do we go about integrating this into the core


#8

I think a first step might be decoupling the main MiniProfiler class from the data source type used for profiling. Once that is done, we can add support for multiple simultaneous data sources.


#9

That way the mongo support can be an optional assembly since it depends on the mongo driver nuget package.