A PostSharp aspect that will log execution time for methods. Data is stored as a Gibraltar metric allowing charting and graphing in Gibraltar Analyst.
You can associate the GTimer attribute with a single method, a property, or an entire class to time all methods in that class. You can also use attribute multicasting to apply it to all matching methods in your assembly.
Timing one method within a class
public class SampleApplication
{
[GTimer]
private void InterestingMethod(int valueOne, String anotherValue)
{
//Do something interesting here
}
}
Timing all methods within a class
[GTimer]
public class SampleApplication
{
private void InterestingMethod(int valueOne, String anotherValue)
{
//Do something interesting here
}
private void AnotherInterestingMethod(int valueTwo, String anotherValue)
{
//Do something even more interesting here
}
}
System.Object
System.Attribute
PostSharp.Extensibility.MulticastAttribute
PostSharp.Aspects.Aspect
PostSharp.Aspects.MethodLevelAspect
PostSharp.Aspects.OnMethodBoundaryAspect
Gibraltar.Agent.PostSharp.GAspectBase
Gibraltar.Agent.PostSharp.GTimer
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2