Skip to content

Test MetricSerializer, EventSerializer and ServiceCheckSerializer#124

Merged
ogaca-dd merged 15 commits intomasterfrom
olivierg/SplitStatsdUnitTest
Jul 29, 2020
Merged

Test MetricSerializer, EventSerializer and ServiceCheckSerializer#124
ogaca-dd merged 15 commits intomasterfrom
olivierg/SplitStatsdUnitTest

Conversation

@ogaca-dd
Copy link
Copy Markdown
Contributor

@ogaca-dd ogaca-dd commented May 26, 2020

This PR splits the class StatsdUnitTests to test MetricSerializer, EventSerializer and ServiceCheckSerializer.

For reviewers:

  • There are few new additions in this PR and most of the changes are code moved / refactored.
    Reviewing commit by commit is recommended to be time efficient.
  • EventSerializer, ServiceCheckSerializer and MetricSerializer have some old code from Statsd but they will be completely refactored in the next PR.

Can be merged when #123 is merged.

result += MetricSerializer.ConcatTags(constantTags, tags);
result += MetricSerializer.ConcatTags(_constantTags, tags);

if (result.Length > MaxSize)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

88643cf#diff-2b2429c2b7220221984fa0ab16b8924eL66:
In the previous version, when truncating the metric, GetCommand overload was called without constantTags which was an issue. As _constantTags is a member of EventSerializer, constantTags is always used in the new version.

}

result += MetricSerializer.ConcatTags(constantTags, tags);
result += MetricSerializer.ConcatTags(_constantTags, tags);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

@truthbk truthbk left a comment

Choose a reason for hiding this comment

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

I have a question, but this looks super clean to me! 💯

@@ -0,0 +1,158 @@
using System;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Very nice test refactor 🍰

Comment thread src/StatsdClient/StatsdBuilder.cs
Comment thread src/StatsdClient/Serializer/ServiceCheckSerializer.cs
Base automatically changed from olivierg/SplitsStatsd to master July 29, 2020 08:36
ogaca-dd added 2 commits July 29, 2020 10:53
…nto olivierg/SplitStatsdUnitTest

# Conflicts:
#	src/StatsdClient/MetricSerializer.cs
@ogaca-dd ogaca-dd merged commit 1354cec into master Jul 29, 2020
@ogaca-dd ogaca-dd deleted the olivierg/SplitStatsdUnitTest branch July 29, 2020 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants