Skip to content

Commit d0cbe88

Browse files
committed
Updated MiniProfiler package to latest version
1 parent e020354 commit d0cbe88

File tree

6 files changed

+20
-11
lines changed

6 files changed

+20
-11
lines changed

src/Plugins/SmartStore.DevTools/DependencyRegistrar.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public virtual void Register(ContainerBuilder builder, ITypeFinder typeFinder, b
2525
if (isActiveModule)
2626
{
2727
// intercept ALL public store controller actions
28-
builder.RegisterType<ProfilerFilter>().AsActionFilterFor<PublicControllerBase>();
28+
builder.RegisterType<ProfilerFilter>().AsActionFilterFor<SmartController>();
2929

3030
//// intercept CatalogController's Product action
3131
//builder.RegisterType<SampleResultFilter>().AsResultFilterFor<CatalogController>(x => x.Product(default(int), default(string))).InstancePerRequest();

src/Plugins/SmartStore.DevTools/Filters/ProfilerFilter.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public void OnActionExecuting(ActionExecutingContext filterContext)
4646
string.Empty;
4747
string controller = string.Concat(filterContext.Controller.ToString().Split('.').Last(), ".");
4848
string action = filterContext.ActionDescriptor.ActionName;
49-
this._profiler.Value.StepStart("ActionFilter", "Controller: " + area + controller + action);
49+
this._profiler.Value.StepStart("ActionFilter", "Action: " + area + controller + action);
5050
}
5151

5252
public void OnActionExecuted(ActionExecutedContext filterContext)
@@ -63,7 +63,8 @@ public void OnResultExecuting(ResultExecutingContext filterContext)
6363
return;
6464

6565
// should only run on a full view rendering result
66-
if (!(filterContext.Result is ViewResultBase))
66+
var result = filterContext.Result as ViewResultBase;
67+
if (result == null)
6768
{
6869
return;
6970
}
@@ -79,10 +80,17 @@ public void OnResultExecuting(ResultExecutingContext filterContext)
7980
"head_html_tag",
8081
"MiniProfiler",
8182
"DevTools",
82-
new { Namespaces = "SmartStore.DevTools.Controllers", area = "SmartStore.DevTools" });
83+
new { area = "SmartStore.DevTools" });
84+
}
85+
86+
var viewName = result.ViewName;
87+
if (viewName.IsEmpty())
88+
{
89+
string action = (filterContext.RouteData.Values["action"] as string).EmptyNull();
90+
viewName = action;
8391
}
8492

85-
this._profiler.Value.StepStart("ResultFilter", string.Format("Result: {0}", filterContext.Result));
93+
this._profiler.Value.StepStart("ResultFilter", string.Format("{0}: {1}", result is PartialViewResult ? "Partial" : "View", viewName));
8694
}
8795

8896
public void OnResultExecuted(ResultExecutedContext filterContext)

src/Plugins/SmartStore.DevTools/Services/IProfilerService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace SmartStore.DevTools.Services
77
{
88
public interface IProfilerService
99
{
10-
void StepStart(string key, string message, bool isVerbose = false);
10+
void StepStart(string key, string message);
1111
void StepStop(string key);
1212
}
1313
}

src/Plugins/SmartStore.DevTools/Services/ProfilerService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ protected MiniProfiler Profiler
2323
}
2424
}
2525

26-
public void StepStart(string key, string message, bool isVerbose = false)
26+
public void StepStart(string key, string message)
2727
{
2828
if (this.Profiler == null)
2929
{
3030
return;
3131
}
3232

3333
var stack = this.steps.GetOrAdd(key, k => new ConcurrentStack<IDisposable>());
34-
var step = this.Profiler.Step(message, isVerbose ? ProfileLevel.Verbose : ProfileLevel.Info);
34+
var step = this.Profiler.Step(message);
3535
stack.Push(step);
3636
}
3737

src/Plugins/SmartStore.DevTools/SmartStore.DevTools.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,9 @@
9191
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
9292
<HintPath>..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
9393
</Reference>
94-
<Reference Include="MiniProfiler">
95-
<HintPath>..\..\packages\MiniProfiler.2.1.0\lib\net40\MiniProfiler.dll</HintPath>
94+
<Reference Include="MiniProfiler, Version=3.1.1.140, Culture=neutral, PublicKeyToken=b44f9351044011a3, processorArchitecture=MSIL">
95+
<SpecificVersion>False</SpecificVersion>
96+
<HintPath>..\..\packages\MiniProfiler.3.1.1.140\lib\net40\MiniProfiler.dll</HintPath>
9697
<Private>True</Private>
9798
</Reference>
9899
<Reference Include="System" />

src/Plugins/SmartStore.DevTools/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
<package id="Microsoft.AspNet.Razor" version="3.2.2" targetFramework="net45" />
88
<package id="Microsoft.AspNet.WebPages" version="3.2.2" targetFramework="net45" />
99
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
10-
<package id="MiniProfiler" version="2.1.0" targetFramework="net45" />
10+
<package id="MiniProfiler" version="3.1.1.140" targetFramework="net45" />
1111
</packages>

0 commit comments

Comments
 (0)