DD only show you the standard events called by SharePoint. Eg OnPreRender, CreateChildControls etc.
If you want to add monitors to a web part, you would need to create a method like this
private void SleepyTime()
using (SPMonitoredScope scope = new SPMonitoredScope("SleepyTime"))
and it would show up in DD from the overridden event from which the method was called
CreateChildControls (50xx ms)
- SleepyTime (5000 ms)
Note that the code above wont run in a sandboxed solution!
You can also create a custom monitored scope using the ISPScopedPerformanceMonitor interface. This is used in conjunction with an overridden constructor
int maxExecutionTime = 1000; // The maximum duration of the monitoring operation, in milliseconds
using (SPMonitoredScope scope = new SPMonitoredScope("SleepyTime", maxExecutionTime, new MyCustomMonitor()))
// MyCustomMonitor implements ISPScopedPerformanceMonitor interface
// If monitoring the scope exceeds the time represented by the maximumExecutionTime value, you can use the maximumExecutionTime value to increase the logging level.