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

[SelfDiagnosticsModule] Write event to log file in a circular way in … #1418

Merged
merged 6 commits into from
Nov 4, 2020

Conversation

xiang17
Copy link
Contributor

@xiang17 xiang17 commented Oct 29, 2020

…EventListener.OnEventWritten

Provide implementation for classes for step#4 in Implementation Plan section of #1258.

Changes

Write event to log file in a circular way in SelfDiagnosticsEventListener.OnEventWritten.

@xiang17 xiang17 requested a review from a team October 29, 2020 01:18
@codecov
Copy link

codecov bot commented Oct 29, 2020

Codecov Report

Merging #1418 into master will increase coverage by 0.15%.
The diff coverage is 85.71%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1418      +/-   ##
==========================================
+ Coverage   81.72%   81.88%   +0.15%     
==========================================
  Files         229      229              
  Lines        6095     6143      +48     
==========================================
+ Hits         4981     5030      +49     
+ Misses       1114     1113       -1     
Impacted Files Coverage Δ
...lemetry/Internal/SelfDiagnosticsConfigRefresher.cs 0.00% <0.00%> (ø)
...Telemetry/Internal/SelfDiagnosticsEventListener.cs 90.90% <91.30%> (+90.90%) ⬆️
src/OpenTelemetry/Sdk.cs 84.61% <0.00%> (-15.39%) ⬇️
...ZPages/Implementation/ZPagesExporterEventSource.cs 56.25% <0.00%> (-6.25%) ⬇️
...tp/Implementation/HttpHandlerDiagnosticListener.cs 78.82% <0.00%> (-0.25%) ⬇️
...tation.AspNetCore/Implementation/HttpInListener.cs 84.67% <0.00%> (-0.13%) ⬇️
...emetry/Internal/DateTimeOffsetExtensions.net452.cs 0.00% <0.00%> (ø)
...rumentation.AspNet/AspNetInstrumentationOptions.cs 100.00% <0.00%> (ø)
...mentation.Http/HttpClientInstrumentationOptions.cs 100.00% <0.00%> (ø)
...ion.AspNetCore/AspNetCoreInstrumentationOptions.cs 100.00% <0.00%> (ø)
... and 2 more

Copy link
Member

@CodeBlanch CodeBlanch left a comment

Choose a reason for hiding this comment

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

A few comments, but LGTM

return position;
}

internal void WriteEvent(string eventMessage, ReadOnlyCollection<object> payload)
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it would work. ReadOnlyCollection implements a bunch of interfaces including IReadOnlyCollection.

I used ReadOnlyCollection because it's the type of the EventWrittenEventArgs.Payload Property. Should I prioritize interfaces over base classes in definition of methods?

Copy link
Member

@reyang reyang left a comment

Choose a reason for hiding this comment

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

LGTM.

@cijothomas cijothomas merged commit 0890a3b into open-telemetry:master Nov 4, 2020
@xiang17 xiang17 deleted the xiang17/self-diagnostics branch November 4, 2020 23:25
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.

5 participants