-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XML documentation updates #139
XML documentation updates #139
Conversation
Add missing XML documentation. Add some missing parameter validation. Updates to grammar in some error messages. Fix some incorrect XML documentation. Make StatsDMessageFormatter internal (so we don't have to document it). Add some extra overloads to TimerExtensions to remove the need to have a parameter for IDisposableTimer if you aren't going to use it, which can help save on allocations. Relates to #130.
The idea behind the new timer overloads is so where before you did this: public void MyMethod()
{
// Whatever
]
public void MyOtherMethod()
{
publisher.Time("mymethod", _ => MyMethod());
} Now you can just do this: public void MyMethod()
{
// Whatever
]
public void MyOtherMethod()
{
publisher.Time("mymethod", MyMethod);
} This removes the need for the compiler to allocate extra delegates to deal with the anonymous lambda required to deal with the |
public interface IDisposableTimer : IDisposable | ||
{ | ||
/// <summary> | ||
/// Gets the name of the statsd bucket associated with the timer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Gets or sets the name" ? It's writable so that you can alter the stat name based on eg. http response code inside the block being timed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good spot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One day I'll convince people StyleCop's a good idea, and that would've found this for me.
The new overloads seem fine. I left one comment. The rest is good too! |
Note that the property is a setter as well as a getter.
StatsDMessageFormatter
internal (so we don't have to document it).TimerExtensions
to remove the need to have a parameter forIDisposableTimer
if you aren't going to use it, which can help save on allocations for delegates if you don't otherwise need a lambda.Relates to #130.