Skip to content
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

Merged
merged 2 commits into from
Oct 11, 2018
Merged

XML documentation updates #139

merged 2 commits into from
Oct 11, 2018

Conversation

martincostello
Copy link
Member

  • 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 for delegates if you don't otherwise need a lambda.

Relates to #130.

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.
@martincostello martincostello added this to the v4.0.0 milestone Oct 10, 2018
@martincostello martincostello requested a review from a team as a code owner October 10, 2018 19:47
@martincostello
Copy link
Member Author

martincostello commented Oct 10, 2018

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 IDisposableTimer parameter.

public interface IDisposableTimer : IDisposable
{
/// <summary>
/// Gets the name of the statsd bucket associated with the timer.
Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good spot.

Copy link
Member Author

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.

@AnthonySteele
Copy link
Contributor

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.
@martincostello martincostello merged commit 0b88061 into justeattakeaway:master Oct 11, 2018
@martincostello martincostello deleted the Add-XML-Documentation branch October 11, 2018 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants