Created
July 22, 2012 08:10
-
-
Save kenegozi/3158878 to your computer and use it in GitHub Desktop.
Statically logging method call latencies
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
interface IDoWork { | |
void DoThis(); | |
string WhatsThat(int that); | |
} | |
class DoWork : IDoWork { | |
public void DoThis() { | |
Log.Action("DoWork.DoThis", () => DoThisImpl() ); | |
} | |
public string WhatsThat(int that) { | |
return Log.Func("DidWork.ChangedTheNameForgotTheString", () => "It is " + that); | |
} | |
} | |
// assuming Log.Method is a way to run the given Action/Func, | |
// meter the latency keyed by method, and do something with the data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment