Last active
August 29, 2015 14:18
-
-
Save leethomascook/140b16bb690ebfdcee65 to your computer and use it in GitHub Desktop.
Mini Profiler Aspect with Postsharp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using PostSharp.Aspects; | |
using StackExchange.Profiling; | |
namespace xxx.Core.Logging | |
{ | |
[Serializable] | |
public sealed class MiniProfilerAttribute : MethodInterceptionAspect | |
{ | |
public override void OnInvoke(MethodInterceptionArgs context) | |
{ | |
using (MiniProfiler.Current.Step(context.Method.DeclaringType.FullName)) | |
{ | |
context.Proceed(); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment