mishrsud / mvc-mini-profiler

Automatically exported from code.google.com/p/mvc-mini-profiler
0 stars 0 forks source link

The UI layer is missing data when WCF is the only place SQL calls are made. #124

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
An issue occurs when the UI layer doesn't make any sql calls but then the WCF 
data comes back with sql calls. The root timing doesn't know there are sql 
timings below in the hierarchy. 

Symptoms: 
    The "query time (ms)" heading is missing from the popup
    The "% in sql" is also missing from the bottom of the popup
    If I click on the " sql" links it shows the grey overlay but no information and throws some jQuery error (it can't find the element).

My Fix: 
I added one line so that when adding "remote" timings we set the 
"hasSqlTimings" field so that the UI knows how to render the box properly. Here 
is the code I modified in MvcMiniProfiler\MiniProfiler.cs: 

/// <summary>
        /// Adds <paramref name="externalProfiler"/>'s <see cref="Timing"/> hierarchy to this profiler's current Timing step,
        /// allowing other threads, remote calls, etc. to be profiled and joined into this profiling session.
        /// </summary>
        public static void AddProfilerResults(this MiniProfiler profiler, MiniProfiler externalProfiler)
        {
            if (profiler == null || externalProfiler == null) return;
            profiler.Head.AddChild(externalProfiler.Root);
            profiler.HasSqlTimings = profiler.GetTimingHierarchy().Any(t => t.HasSqlTimings);
        }

http://stackoverflow.com/questions/8226158/miniprofiler-cant-display-sqltimings/
8227880#8227880

Original issue reported on code.google.com by paullem...@gmail.com on 22 Nov 2011 at 1:52

GoogleCodeExporter commented 8 years ago
Hello,

I created a pull request for this issue.

https://github.com/SamSaffron/MiniProfiler/pull/16

Original comment by michel.r...@gmail.com on 23 Feb 2012 at 12:28

GoogleCodeExporter commented 8 years ago
Cheers, pulled it 

Original comment by sam.saff...@gmail.com on 27 Feb 2012 at 1:44