【发布时间】:2010-01-22 00:56:51
【问题描述】:
我想针对一些在测试和生产中运行的服务运行分析代码。我的计划是使用 PostSharp 来实现一个看起来像
的类 public class TimerAttribute : OnMethodBoundaryAspect
{
//some data members
//...
public override void OnEntry(MethodExecutionEventArgs eventArgs)
{
//write method entry time to file
}
public override void OnExit(MethodExecutionEventArgs eventArgs)
{
//write method exit time to file
}
}
在我走得太远之前,我应该注意哪些潜在的陷阱?这些方法的广泛使用(即仅在 assemblyinfo 中添加一行)会导致严重的(就时序数据的有效性而言)性能问题?
【问题讨论】:
标签: .net profiling aop postsharp